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

Handle incomplete messages in launcher IPC #151

Open
4 tasks
rzaba0 opened this issue Sep 4, 2022 · 0 comments
Open
4 tasks

Handle incomplete messages in launcher IPC #151

rzaba0 opened this issue Sep 4, 2022 · 0 comments

Comments

@rzaba0
Copy link
Contributor

rzaba0 commented Sep 4, 2022

Current code assumes that we'll be able to receive and send messages with 1 system call. Since that isn't always the case, we need to handle scenarios where we receive or send incomplete messages.

When it comes to sending, I'm fine with just looping until we send the whole message. For receiving, however, I think we should modify our current message handler, so that it checks whether we received the full message. There are different approaches for this, such as sending end-of-message marker with every message.

See the discussion - #149 (comment)

  • Find reproducible cases where messages need more than 1 system call. This will allow testing the implementation.
  • For sending, loop the Write call until we send full message. This is the simplest approach, though it may block our thread for some time. However, I doubt it will be a problem.
  • Decide how to detect full message when receiving - end-of-message marker, JSON.
  • Implement receiving, but remember not to wait forever until the full message.
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

No branches or pull requests

1 participant