Added safe subprocess handling to prevent blocked threads.

Review Request #2620 — Created Sept. 25, 2011 and submitted

Information

Review Board

Reviewers

Added safe subprocess handling to prevent blocked threads.

The patch subprocess waits for input from stdin, and if Review Board hits
and exception before it can provide that stdin, the process will continue
to wait in the background.

Addresses issue #1862.

Setting breakpoint.
Manual at this point.  I set a breakpoint just before we call the patch process, and then set the diff variable to None (not the empty string, mind you, but None).  This triggered the blocking patch process for me.

Anyhow, with this patch, that blocking process gets cleared.

If anybody has any ideas on how I might more accurately reproduce the problem in issue 1862, please let me know, and I'll write a real test for it.
Description From Last Updated

I think this would be worth pulling out into something more reusable. The question is, do we put it in …

chipx86chipx86
chipx86
  1. 
      
  2. reviewboard/diffviewer/diffutils.py (Diff revision 1)
     
     
     
    Show all issues
    I think this would be worth pulling out into something more reusable. The question is, do we put it in djblets, or Review Board?
    
    At the very least for now, how about a top-level thing in diffutils?
    1. How about djblets/util/misc.py?
  3. 
      
mike_conley
david
  1. Ship It!
  2. 
      
mike_conley
Review request changed
Status:
Completed
Change Summary:
Pushed to master (e15c208)