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

feat(sync_handlers): send partial db getter results asap #1763

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

CHr15F0x
Copy link
Member

@CHr15F0x CHr15F0x commented Feb 14, 2024

We don't need to "collect" all results for the requested range before sending them to the p2p loop for forwarding.

@CHr15F0x CHr15F0x marked this pull request as ready for review February 15, 2024 09:35
@CHr15F0x CHr15F0x requested a review from a team as a code owner February 15, 2024 09:35
Copy link
Contributor

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Choose a reason for hiding this comment

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

Might be a dumb question: but why do we need flume for this? Would a normal channel not suffice?

@CHr15F0x
Copy link
Member Author

Would a normal channel not suffice?

The "normal" channel is currently a futures::channel, for which the sender only implements a non-async try_send so we would have to implement error handling and retrying in a smart way to avoid busy looping in the thread from the tokio blocking thread pool which imo is not worth it.

@Mirko-von-Leipzig
Copy link
Contributor

Would a normal channel not suffice?

The "normal" channel is currently a futures::channel, for which the sender only implements a non-async try_send so we would have to implement error handling and retrying in a smart way to avoid busy looping in the thread from the tokio blocking thread pool which imo is not worth it.

Does this mean we should grep for other blocking usage of tokio channels to replace them?

@CHr15F0x CHr15F0x changed the title feat(sync_handlers): use flume to send partial db getter results asap feat(sync_handlers): send partial db getter results asap Feb 19, 2024
@CHr15F0x
Copy link
Member Author

Flume was not required, following an offline discussion with @Mirko-von-Leipzig , I've switched to tokio::mpsc and then Sender::blocking_send.

@CHr15F0x CHr15F0x merged commit 19db42d into main Feb 21, 2024
7 checks passed
@CHr15F0x CHr15F0x deleted the chris/sync-handlers-use-fume branch February 21, 2024 15:32
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.

2 participants