Refactored checkpointing system#2595
Conversation
1256f71 to
85c244b
Compare
|
@qstokkink can you please check the first three commits of my PR to see whether it's not too disruptive for your work (since you're currently working with the download mechanism)? The work in this PR is not completely done yet since I have to fix some additional tests and add notifications for the state of the video player. |
|
@devos50 I don't see any issues at all 👍 . |
|
@qstokkink great! |
|
Now that we don't have a grace time when shutting down, it turns out that we are never waiting until the socks5 server is completely shut down (https://github.com/Tribler/tribler/blob/devel/Tribler/community/tunnel/Socks5/server.py#L319), leading to dirty reactor errors. Returning a deferred from this method requires the EDIT: it might not be as much work as I initially thought. The consequence is that the |
|
@devos50 I think a |
|
download.stop ()... etc.. Looking forward to testing the impact of all this on my Linux,Mac and Win boxes. |
|
@qstokkink a Fortunately, the |
|
@synctext FYI, this PR significantly improves the speed of the test suite (on Mac, it went from 4 minutes to 3 minutes duration: https://jenkins.tribler.org/job/GH_Tribler_PR_tests_mac/3384/ vs https://jenkins.tribler.org/job/GH_Tribler_PR_tests_mac/3381/. But this comparison might a bit unfair since not all tests are passing yet... |
|
It also improves the speed of a Tribler shutdown in general :) |
|
Even worse: it turns out that we don't wait until Dispersy is correctly closed... (https://github.com/Tribler/tribler/blob/devel/Tribler/Core/APIImplementation/LaunchManyCore.py#L786 returns a |
|
Fixed both issues in #2601 so that PR should be merged first. |
59ec003 to
631128e
Compare
|
retest this please |
|
retest this please |
|
@ardhipoetra it turns out that there is a |
b49dfc4 to
7a10fa6
Compare
|
retest this please |
1 similar comment
|
retest this please |
f3ba612 to
f49d857
Compare
|
retest this please |
1 similar comment
|
retest this please |
The resume data was not saved due to various bugs in the code. I refactored the complete checkpoint mechanism so it is more twisted-like. Moreover, we now wait until the checkpointing has been completed before continuing the shutdown procedure of Tribler.
In setUp and tearDown of tests.
f49d857 to
34b2b4f
Compare
|
retest this please |
|
Seems stable! |
I've found out that our resume data is not written away which can be addressed to the checkpointing mechanism and the fact that we are not waiting on our shutdown deferred when closing Tribler from the twistd plugin.
In this PR, I've refactored the complete checkpointing mechanism to make it more simple and so it is using Twisted. Moreover, I've created a
get_handlemethod for each download that returns a deferred that fires when the libtorrent handle is available and valid. This allowed me to remove thewaitForHandleAndSynchronizedmethod which was rather ugly.Also, various Twisted issues have been fixed, i.e. when we don't wait for a deferred to fire.
Fixes #2531