[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-05-03 Thread Vinay Sajip
Vinay Sajip added the comment: I noticed that in my cleanup code, I had the lines h.close() remover.join() but it makes more sense for these to be in the opposite order. I've made that changed and pushed it up (for 2.7, 3.2 and default). -- ___ Py

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-05-02 Thread Brian Curtin
Brian Curtin added the comment: I have exemptions set in AV for my dev folders for exactly that reason :) I'll try and poke around and get more info. -- ___ Python tracker ___ _

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-05-02 Thread Vinay Sajip
Vinay Sajip added the comment: The changeset you mentioned doesn't have a cleanup function in test_race (an older version used to) - so I'm not sure where that error is coming from. It's going to be hard for me to reproduce this - I was finding it pretty hard to throw up the original race con

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-05-02 Thread Vinay Sajip
Vinay Sajip added the comment: The only thing I can think of is that the file is kept open by something else (the other thread). -- ___ Python tracker ___ _

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-05-02 Thread Brian Curtin
Brian Curtin added the comment: I'm seeing this with the current tip 8635825b9734. I wouldn't trust the build slaves with a race condition test since they're incredibly slow machines, but this issue isn't about the race. That path really should be accessible so I'm not sure why it's failing.

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-05-02 Thread Vinay Sajip
Vinay Sajip added the comment: Re. the error on open(), I have no idea why it's failing. That's just open, and it appears to be trying to open a file in a directory for which one would expect you to have write access. Re. the error on unlink(), could that be an older version of the code that

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-05-01 Thread Brian Curtin
Brian Curtin added the comment: The test for this issue seems to fail about half of the time on Windows. == ERROR: test_race (test.test_logging.HandlerTest) -

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-26 Thread Vinay Sajip
Vinay Sajip added the comment: Buildbots seem not to be complaining, so closing. -- status: open -> closed ___ Python tracker ___ ___

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-24 Thread Vinay Sajip
Vinay Sajip added the comment: I will leave this open for a few days and see if the buildbots throw up anything. -- resolution: -> fixed ___ Python tracker ___ ___

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 15a33d7d2b50 by Vinay Sajip in branch '2.7': Issue #14632: Updated WatchedFileHandler to deal with race condition. Thanks to John Mulligan for the problem report and patch. http://hg.python.org/cpython/rev/15a33d7d2b50 New changeset 5de7c3d64f2a b

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-24 Thread Charles-François Natali
Charles-François Natali added the comment: > I can't see why this always works, while John's script sometimes fails. It does fail consistently on my machine. I'm attaching the diff just in case. -- Added file: http://bugs.python.org/file25345/test_logging_race.diff ___

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-23 Thread Vinay Sajip
Vinay Sajip added the comment: [snip] >With this change, I can trigger a failure reliably in around 1s, and >my computer is rather slow. I'm working in a VM, and although I can get John's script to fail more regularly (with the reduced timeouts and counts of 1000), a version of the test which

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-23 Thread Charles-François Natali
Charles-François Natali added the comment: > Charles-François: Certainly I can reduce the iterations to make the test > faster. As it is, I did reproduce the failure on my dev system, but only > once, after running John's test script about a dozen times: every other > time, it completed successf

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-22 Thread Vinay Sajip
Vinay Sajip added the comment: John: Thanks for the updated patch. Charles-François: Certainly I can reduce the iterations to make the test faster. As it is, I did reproduce the failure on my dev system, but only once, after running John's test script about a dozen times: every other time, it

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-22 Thread Charles-François Natali
Charles-François Natali added the comment: > There's certainly a problem to be addressed here, but integrating the test > into the regular test suite represents a problem in that the test takes > around 10 minutes to run, and sometimes completes successfully. I'm not sure > a 10-minute extens

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-22 Thread JohnM
JohnM added the comment: Thank you both for looking at this. I've added an updated version of the patch that incorporates the last two suggestions that Charles-François made. I agree that this test may not be appropriate for the python test suite, due to the length and non-determinism of the

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-22 Thread Vinay Sajip
Vinay Sajip added the comment: There's certainly a problem to be addressed here, but integrating the test into the regular test suite represents a problem in that the test takes around 10 minutes to run, and sometimes completes successfully. I'm not sure a 10-minute extension of the time take

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-21 Thread Vinay Sajip
Changes by Vinay Sajip : -- assignee: -> vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-21 Thread Charles-François Natali
Charles-François Natali added the comment: Thanks for the report and patch. I'm making Vinay nosy, as he's the logging expert. A couple remarks: - it would be nice to add your testcase to the logging tests (Lib/test/test_logging.py) - I think you could probably save the whole fstat() result (

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-20 Thread JohnM
JohnM added the comment: I'm attaching a patch of an emit function implementation that reduces the number of stats and uses fstat were we can. Using fstat should also prevent any races between opening the new file and stating the path in the file system. Using this patch or something along th

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-20 Thread JohnM
New submission from JohnM : The (very handy) logging.handlers.WatchedFileHandler appears to be susceptible to a race condition that causes occasional OSErrors during the normal course of operations: Traceback (most recent call last): File "test.py", line 58, in test_race log.warning('F