Skip to content

Better signal handling#1488

Merged
leaanthony merged 2 commits into
masterfrom
feature/better-signal-handling
Jun 24, 2022
Merged

Better signal handling#1488
leaanthony merged 2 commits into
masterfrom
feature/better-signal-handling

Conversation

@leaanthony

Copy link
Copy Markdown
Member

Noticed ctrl-c isn't handled and leads to ungraceful shutdown.

@leaanthony leaanthony requested a review from stffabi June 23, 2022 11:12
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 23, 2022

Copy link
Copy Markdown

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: c221bc9
Status:⚡️  Build in progress...

View logs

@stffabi stffabi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice improvement 👍. LGTM, just a minor comment if we need the waitgroup.

Comment thread v2/internal/signal/signal.go Outdated
gosignal.Notify(signalChannel, os.Interrupt, syscall.SIGTERM, syscall.SIGINT)

m.wg.Add(1)
var wg sync.WaitGroup

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems like we are not calling wg.Wait() anywhere. Are we maybe missing that or could we just remove the waitgroup completely?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Looks like it was left in after the simplification. I'll remove it

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.

2 participants