Skip to content
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

allow connections while checking resume data if no_verify_files flag is set #7754

Merged
merged 1 commit into from
Oct 20, 2024

Conversation

e1y4s
Copy link

@e1y4s e1y4s commented Oct 17, 2024

When adding a torrent with peers, if metadata is already available and the torrent is in checking_resume_data state, torrent::want_peers() currently returns false. This behavior prevents torrent::do_connect_boost() from initiating connections, leading to delays.

This modification addresses the issue by permitting peer connections in this scenario when no_verify_files flag is set.

@e1y4s e1y4s force-pushed the connect-while-resume-check branch from cc5d3e0 to af561d0 Compare October 18, 2024 17:04
Copy link
Owner

@arvidn arvidn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! looks good. It's kind of subtle, it might warrant a comment in the code explaining this carve-out. Would you mind adding an entry to the Changelog as well?

@joriscarrier
Copy link
Contributor

@arvidn One more question: why don't you want to connect to peers while checking files (m_state == torrent_status::checking_files)?

@e1y4s e1y4s force-pushed the connect-while-resume-check branch 2 times, most recently from 5407aa2 to 4f83cb9 Compare October 20, 2024 14:26
@e1y4s
Copy link
Author

e1y4s commented Oct 20, 2024

thanks! looks good. It's kind of subtle, it might warrant a comment in the code explaining this carve-out. Would you mind adding an entry to the Changelog as well?

Thanks! Just added both. Let me know if anything else needs adjustment.

@e1y4s e1y4s force-pushed the connect-while-resume-check branch from 4f83cb9 to 3084b09 Compare October 20, 2024 15:28
@arvidn
Copy link
Owner

arvidn commented Oct 20, 2024

@joriscarrier

why don't you want to connect to peers while checking files (m_state == torrent_status::checking_files)?

Although it would be possible to check files while participating in the swarm it's more complicated and isn't supported by the torrent/piece-picker (and possibly not the disk I/O system). The unchecked pieces would need a new state to indicate that they can't be picked for downloading, even though their priority may be non-zero.

For historical reasons, checking has been a separate state where we, essentially, don't have a piece picker.

@arvidn arvidn merged commit 911011e into arvidn:RC_2_0 Oct 20, 2024
42 checks passed
@arvidn
Copy link
Owner

arvidn commented Oct 20, 2024

@e1y4s thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants