-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
astropy.log: The process cannot access the file because it is being used by another process #507
Conversation
Hrm...disabling that one test did seem to go better, though the full build still didn't succeed due to github timing out on some of the later configurations. But until that happened all the previous configurations succeeded. Giving it one more try. |
What I don't understand is why it should care at all that another file object is using it. There isn't supposed to be any locking or anything. So why doesn't it just append to the file with no concern that another object is using it? |
Well I found that the test it's occurring on maybe does have something to do with it--when I disable that test I don't see this error. It's still very odd though. |
Definitely very odd. I guess the workaround is to skip that one test if you're on windows? If it appears somewhere else later perhaps it requires more investigation... |
I'll go ahead and assign myself to this so that it doesn't get lost, and I'll just disable that test on Windows so I can move forward on merging #495. I still want to figure out what's going on here at some point though. |
…m that it *does* pass when the test suite is run outside of Jenkins, even on the configurations where it was failing.
I'm getting this error now in a different test that was included in 3e0fe42. I'm not sure the error is directly related to the logging, because if I disable all logging to files all that happens is the process exits without reporting anything. It's more like it's segfaulting. |
…hack I was using before, and refactors so that when compressing an image, the compression module handles creation of the new Numpy array, and only once CFITSIO is complete and we know how large the compressed data buffer is going to be. Then compress_hdu() returns the new Numpy array along with the heapsize. This is a lot less spaghetti-ish than the previous code, and somewhat simpler overall. Removed the test_insufficient_compression_allocation test since it no longer works correctly with the new code. But that's okay--the test_lossless_gzip_compression test tests this case for us implicitly, which is why it was failing on Windows in the same way. This is because the way CFITSIO estimates how much space it will need for the compressed data, it always ends up being less than what's needed for lossless compression.
The attached PR fixes the issue as originally reported, and fixes a new issue that cropped up in 3e0fe42 which had the same symptoms and turns out to be caused by the same thing. In short, my hacked around fake realloc was causing an access violation on Windows, though not usually on Linux. This refactors the |
Assuming the tests for this pass on Travis, I need to merge this soon as it's causing the tests to fail on Windows. |
Seems fine to me, but why did you delete the test for it? Or is that using some of the code you deleted (I didn't see where, but I admit I'm not fully understanding this) |
@eteq As explained in the commit message, the test that was deleted no longer makes sense with the way the code was reorganized, but there's a different test that tests the same corner case implicitly (it's a difficult case to force explicitly which is what the old test did). |
astropy.log: The process cannot access the file because it is being used by another process
… a handle to test.fits is kept open by the mmap. I suppose this could also use memmap=False. I thought I had included this commit before I merged the original PR for astropy#507 but apparently I did not.
astropy.log: The process cannot access the file because it is being used by another process
…m that it *does* pass when the test suite is run outside of Jenkins, even on the configurations where it was failing.
c:\windows\temp\tmpyzcvmqastropy_config\astropy\astropy.log: The process cannot access the file because it is being used by another process
This is an error I get sometimes when the tests are run in Windows on Jenkins. Right now this is only happening in my staging branch where I'm testing #495, though I'd like to merge that work.
It always happens at the exact same point in the tests. To give a little further context:
It seems like the test runner itself is crashing, because the tests just stop there. The test it's stopping at is a slightly bizarre one, but it doesn't do anything I can think of that would affect the log, so I'm not convinced the test itself is relevant (though I might try disabling it). This occurs on some test configurations but not others, though I haven't discerned any pattern so I think it's more or less non-deterministic. When I run the tests manually in the same configuration it does not occur, so it seems like it might be due to an interaction with Jenkins.
Any hypotheses?