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

Merged
merged 6 commits into from
Jun 5, 2024

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.

grddev added 6 commits March 6, 2024 11:55
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.
@grddev grddev force-pushed the limit-response-poll branch from 6fafc74 to 4ef3a85 Compare March 6, 2024 10:56
@ethanf ethanf self-requested a review June 5, 2024 18:31
@ethanf ethanf merged commit 6932b0c into lirm:master Jun 5, 2024
3 checks passed
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