Add XDECREF for returned read tuple in ReadParser.read_pair_iterator()#693
Conversation
|
@camillescott thank you for finding this and providing a fix |
|
|
@mr-c: easiest way is to run: Observe memory usage while it runs, and the leak will be obvious. Call |
|
I can confirm the memory and the fix |
|
I get After testing without the fix. This is inelegant, looking into that now. |
|
ReadParser throws that exception when it runs out of reads, presumably to mimic a Python iterator (for reasons I'm not entirely sure of). Is it only throwing that when multiple threads are in use? 'Cause it looks like the CPython iterator isn't thread-safe: there's a race condition there if another thread depletes the parser after checking Potential solution: catch the |
|
This was just the test code above. So single-threaded? |
|
@camillescott and I have fixed the segfault that we inadvertently found due to a corrupted file in @ctb homedir. |
|
Bonus: I've removed the unused callback code which has increased our code coverage.
|
|
Not to rain on the code-axing parade, but some of that callback stuff is potentially useful for me. |
|
I'll split that into another PR for a proper discussion. |
|
which means I'll be force pushing to this branch in a moment, do beware! |
1b0cd84 to
2943a5b
Compare
|
branch force done. |
|
Ready for review & merge @ctb @camillescott @luizirber |
|
Looks good to me; merging. |
Add XDECREF for returned read tuple in ReadParser.read_pair_iterator()
|
Actually, I missed the wonky ChangeLog formatting. @mr-c, can this be fixed? |
Pull request for #692