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

fix: ensure we receive all messages we expect #236

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maxmoehl
Copy link

After sending a message only a single call to conn.Receive is made which can cause messages to queue up in the receive buffer if not all messages can be returned at once. This causes ENOBUFS as the kernel is unable to write any further messages.

This commit introduces a check that ensures we call conn.Receive as often as needed to get the right number of responses: one for acknowledgment and one for the echo.

Resolves: #235

After sending a message only a single call to `conn.Receive` is made
which can cause messages to queue up in the receive buffer if not all
messages can be returned at once. This causes `ENOBUFS` as the kernel is
unable to write any further messages.

This commit introduces a check that ensures we call `conn.Receive` as
often as needed to get the right number of responses: one for
acknowledgment and one for the echo.

Resolves: google#235
@maxmoehl
Copy link
Author

I made this a draft because I noticed that it does not fix the issue in all scenarios. Running a loop with one RuleAdd and Flush still causes the buffer issue. I'm not yet able to tell why but maybe someone else has an idea based on what I already shared in the issue.

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.

Not all response messages are received causing the receive buffer to overflow
1 participant