The Wayback Machine - https://web.archive.org/web/20201107082134/https://github.com/uNetworking/uWebSockets/issues/1056
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

Close/skip backpressure behavior switch #1056

Open
alexhultman opened this issue May 20, 2020 · 5 comments
Open

Close/skip backpressure behavior switch #1056

alexhultman opened this issue May 20, 2020 · 5 comments

Comments

@alexhultman
Copy link
Member

@alexhultman alexhultman commented May 20, 2020

It should be possible to enable the former close-on-backpressure behavior when pub/subbing

Probably add us_socket_deferred_close() as a way to close down the reading side thus causing error-close next iteration (?)

@alexhultman alexhultman added the v18 label May 20, 2020
@alexhultman
Copy link
Member Author

@alexhultman alexhultman commented Jun 22, 2020

Sending and publishing should never immediately call close handler as that often leads to complex recursion/reentry bugs.

@alexhultman
Copy link
Member Author

@alexhultman alexhultman commented Jun 27, 2020

This makes a lot of sense to add. Some users would surely require an in-order stream where too much backpressure simply leads to a close rather than skip. Skipping is only valid for application protocols that do not deal with history where previous messages are important. Therefore this feature is important to add.

@alexhultman
Copy link
Member Author

@alexhultman alexhultman commented Jun 27, 2020

maxBackpressure = number
backpressureMitigation = CLOSE | SKIP

Shutting down the read side of the socket seems to work the same on BSD sockets and WinSock so using that feature sounds perfect here.

@psy0rz
Copy link

@psy0rz psy0rz commented Aug 13, 2020

I'm currently testing my backpressure handling by adding a DROP-rule to the firewall.

I noticed i can send several MB's before i get a back-pressure build up. Is this normal? Where is the data stored? Is that size configurable? I would have expected to only be able to send maybe a few KB's before i got backpressure.

Edwin

@alexhultman-2fa
Copy link
Contributor

@alexhultman-2fa alexhultman-2fa commented Aug 13, 2020

Yes that's normal, the data is stored in kernel space. You can configure pretty much everything in this regard.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.