<div>I am wondering if someone would be willing to assist me in debugging a problem I'm experiencing with my current attempt at an implementation of spawnProcess for the IOCP proactor.</div>
<div> </div>
<div>A patch with my implementation can be found at <a href="http://twistedmatrix.com/bugs/issue1008">http://twistedmatrix.com/bugs/issue1008</a> along with comments and a log file describing my problem.</div>
<div> </div>
<div>The problem occurs sporadically when running twisted.test.test_process.ProcessTestCase.testProcesstwisted.test.test_process. First I create 3 pipes that will be used to write to the child process's stdin and read its stdout and stderr. Then I initiate a read on all 3 pipes. The reads makes sense for stdout and stderr. The stdin pipe is created in duplex mode and the read attempt on it from the parent is only there so we can detect when the child closes its end of the pipe so the parent can close its end as well.
</div>
<div> </div>
<div>The problem is that occasionally (often, but not consistently) the read operations on stdin (and sometimes stderr) seem to not run at all and FileMon reports their status as CANCELLED when I get to the end of the program. If I run trial run through pdb and step through it, the result of CANCELLED for these 1 or 2 (if stderr fails as well) reads doesn't appear until the very end of the program. The callbacks (
ReadInOp.ovDone and ReadErrOp.ovDone don't get called for either of these when the failure occurs, so FileMon's results seem to accurately reflect what is happening. However, from my print statements it is clear that the reads are initiated (
ReadInOp.initiateOp and ReadErrOp.initiateOp).</div>
<div> </div>
<div>The closest thing I can find to a description of what CANCELLED might mean is at <a href="http://www.cs.princeton.edu/~appel/smlnj/basis/posix-error.html">http://www.cs.princeton.edu/~appel/smlnj/basis/posix-error.html
</a> which says it indicates that the associated asynchronous operation was cancelled before completion. This sounds correct, but doesn't help illuminate *why* this is happening.</div>
<div> </div>
<div>Does anyone have any suggestions as to why this is happening?</div>
<div> </div>
<div>Thanks in advance.</div>
<div>Justin</div>