Skip to content

Comments

Handle signals in dist mode#1629

Closed
drahnr wants to merge 2 commits intomainfrom
bernhard-port-cachepot-139
Closed

Handle signals in dist mode#1629
drahnr wants to merge 2 commits intomainfrom
bernhard-port-cachepot-139

Conversation

@drahnr
Copy link
Collaborator

@drahnr drahnr commented Feb 27, 2023

Handles signals in dist mode by adding them as a future and select!.

Ref #1620

Orignal work by @montekki

@drahnr drahnr self-assigned this Feb 28, 2023
@drahnr drahnr requested a review from Xanewok February 28, 2023 08:26
@sylvestre
Copy link
Collaborator

should we manage the HUP signal ?

@drahnr
Copy link
Collaborator Author

drahnr commented Mar 3, 2023

We could and should, but I think that's a separate concern for another PR and requires some additional logic

@sylvestre sylvestre force-pushed the bernhard-port-cachepot-139 branch from 1e0424e to bec3a64 Compare March 3, 2023 12:43
@sylvestre
Copy link
Collaborator

makes sense
I guess you saw that it fails to build

@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.07 🎉

Comparison is base (245912d) 29.44% compared to head (d65edea) 29.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1629      +/-   ##
==========================================
+ Coverage   29.44%   29.52%   +0.07%     
==========================================
  Files          49       49              
  Lines       17713    17713              
  Branches     8544     8547       +3     
==========================================
+ Hits         5216     5229      +13     
+ Misses       7348     7340       -8     
+ Partials     5149     5144       -5     

see 14 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

* Handle signals in dist

* Adds a comment
@sylvestre sylvestre force-pushed the bernhard-port-cachepot-139 branch from bec3a64 to 2cc624e Compare March 20, 2023 09:29

// Whenever `docker` or `systemd` stop the service, the signals
// have to be processed and the app has to perform a graceful stop.
select! {
Copy link

@mati865 mati865 Jun 2, 2023

Choose a reason for hiding this comment

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

By the default select will randomly pick the order of polling. You can make it use the order you have specified (also avoiding calling random) by adding biased.
I'm on my mobile but it should look something like this:

Suggested change
select! {
select! {
biased;

@sylvestre sylvestre closed this Feb 22, 2024
@drahnr
Copy link
Collaborator Author

drahnr commented Feb 22, 2024

I'll get back to this eventually

@sylvestre
Copy link
Collaborator

thanks :)
I have been doing cleanup of old PR

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.

5 participants