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

SocketWriteBuffer: only throw buffer error once per channel #13665

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CamilleLetavernier
Copy link
Contributor

refs #13662

What it does

  • add a flag in SocketWriteBuffer to only throw errors once.
  • export ReconnectableSocketChannel to make it easier to override buffer behavior in custom applications

I'm not really satisfied with this patch, as I was hoping we could only block the "logging" part of the issue. But since the Max disconnected buffer size exceeded is handled pretty late, it's hard to prevent multiple logs while still throwing the exception; so I'm only throwing the exception once, and then silently ignoring following errors, which is a bit awkward. I'm not quite sure how to properly solve this issue.

Regarding the exported types, I would be tempted to also change the visibility of some fields in both classes (ReconnectableSocketChannel and SocketWriteBuffer) from private to protected; as without this, actually overriding the behavior is pretty difficult. Thoughts?

How to test

See #13662

Follow-ups

If we could detect that the client "closed" or "refreshed" the tab (as opposed to "lost connection"), we could probably immediately clean up the session. Even if the client reopens the tab, it will happen with a different frontendId, so it will not rely on the disconnected socket buffer. However, this is probably a more complex task.

Review checklist

Reminder for reviewers

@CamilleLetavernier CamilleLetavernier marked this pull request as ready for review April 29, 2024 13:33
- avoid logging the same error multiple times in SocketWriteBuffer.
throw once, then silently ignore following issues.
- export ReconnectableSocketChannel to make buffer customization easier
for applications

refs eclipse-theia#13662

Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting on reviewers
Development

Successfully merging this pull request may close these issues.

None yet

1 participant