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

Use ControlledPoll for PollForResponse and PollForErrorResponse #102

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

grddev
Copy link
Contributor

@grddev grddev commented Mar 6, 2024

PollForResponse consumed responses after the response it was looking for in the incoming response stream, which specifically made it impossible to poll for replication initialization errors when setting up a replication, as they were consumed by the PollForResponse inside the Replicate operation.

This also updated PollForErrorResponse to reset the error between polls, or else it would just immediately return the previous error.

This also adds some tests for the two methods. The tests are nowhere near complete, but should give some coverage for the changes implemented here.

This covers the basic behavior of consuming responses. Arguably, they do a lot more as they e.g. dispatch recording signals and whatnot, but this is a start.
The idea here is that we want to reimplement the PollForResponse methods using ControlledPoll, without having to update the tests.
This iteration just returns action continue on the top level everywhere, so this shouldn't really have any impact so far.
This updates the code to poll for up to 10 fragments at once, but we use the controlled poll as a mechanism to ensure we are not committing to more messages than what is needed.
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.

None yet

1 participant