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

[signal] Fix context propagation in signal server #3251

Conversation

4thel00z
Copy link
Contributor

  • Use guardian pattern to reduce control flow depth
  • Fixed variable & package name clash
  • Propagate ctx in Server.Send
  • Enable graceful shutdown in Server.ConnectStream, by honoring <-stream.Context().Done()

Describe your changes

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

- Use guardian pattern to reduce control flow depth
- Fixed variable & package name clash
- Propagate ctx in Server.Send
- Enable graceful shutdown in Server.ConnectStream, by honoring <-stream.Context().Done()

Signed-off-by: 4thel00z <[email protected]>
@CLAassistant
Copy link

CLAassistant commented Jan 29, 2025

CLA assistant check
All committers have signed the CLA.

@mlsmaycon
Copy link
Collaborator

Thanks, @4thel00z, for the contribution. We will review it soon

@4thel00z
Copy link
Contributor Author

4thel00z commented Feb 1, 2025

No problem, happy to remove any merge blockers.

@4thel00z
Copy link
Contributor Author

4thel00z commented Feb 1, 2025

I'm seeing that the amd64 postgres benchmark is failing also for other PRs.
Do you want me to address that in another PR ? @mlsmaycon

@pascal-fischer
Copy link
Contributor

Hi @4thel00z, thanks for the PR. I had a look a few days ago and the code looks good. I do need to test it, which I didn't get around to yet. I think there was a reason for the context.Background() but I will confirm once I tested.

Regarding the benchmarks, they sometimes fail if they are defined too strictly and the runner has a particularly bad day. You don't need to adjust those. A simple re-run of the test will help, and we will adjust them later if needed.

Copy link
Contributor

@pascal-fischer pascal-fischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok the context.Background() is not required anymore. That's a leftover from code that is long gone. The looks good, I tested and everything is fine.

@pascal-fischer pascal-fischer merged commit 58b2eb4 into netbirdio:main Feb 7, 2025
41 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.

4 participants