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

fork_worker changes systemd status to reloading when reforking #3273

Open
MrSerth opened this issue Nov 2, 2023 · 1 comment
Open

fork_worker changes systemd status to reloading when reforking #3273

MrSerth opened this issue Nov 2, 2023 · 1 comment

Comments

@MrSerth
Copy link

MrSerth commented Nov 2, 2023

Describe the bug
There might be a bug that is caused by the combination of fork_worker together with the systemd notification integration (also known as SdNotify). When both are active, reforking will change the Active status in systemd to reloading (reload), but never changes it back.

Puma config:

# frozen_string_literal: true

workers 5
fork_worker
preload_app! false
/usr/local/bin/bundle exec puma -C puma.rb -b tcp://0.0.0.0:9292 hello.ru

To Reproduce
I've created a minimal repository with reproduction steps: MrSerth/puma-refork-systemd.

Current behavior
A refork signals to systemd that a reload is being performed. This signal never gets changed to ready again.

Expected behavior
Either, a refork is signalled as reload and, once finished, signalled as finished OR the refork is not changing the systemd status at all. I would prefer the second option (no signalling to systemd at all, since we are not completely reloading the application).

Desktop:

  • OS: Linux
  • Puma Version: 6.4.0
@MSP-Greg
Copy link
Member

Thanks for workingon the repo example. I've got a test verifying this behavior.

A quick look at possible fixes showed that 'no signalling to systemd at all' might be messy, but 'reloading' followed by 'ready' is what I'm thinking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants