Navigation Menu

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

Restart openqa-worker-auto-restart@.service on pkg upgrade without interrupting jobs #3699

Merged
merged 1 commit into from Feb 2, 2021

Conversation

Martchus
Copy link
Contributor

@Martchus Martchus commented Jan 28, 2021

  • Only affects openqa-worker-auto-restart@.service units but not other
    worker units
  • Does nothing if no such units are running
  • The shell code is adapted from the %service_del_postun macro (from
    /usr/lib/rpm/macros.d/macros.systemd as provided by the
    systemd-rpm-macros package)
  • See https://progress.opensuse.org/issues/80908#note-8

Copy link
Member

@okurz okurz left a comment

Choose a reason for hiding this comment

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

+1

…terrupting jobs

* Only affects `openqa-worker-auto-restart@.service` units but not other
  worker units
* Does nothing if no such units are running
* The shell code is adapted from the `%service_del_postun` macro (from
  `/usr/lib/rpm/macros.d/macros.systemd` as provided by the
  `systemd-rpm-macros` package)
* See https://progress.opensuse.org/issues/80908#note-8
@Martchus
Copy link
Contributor Author

Martchus commented Feb 1, 2021

Seems like it worked:

Feb 01 10:38:28 linux-9lzf worker[15778]: [info] Registering with openQA localhost
Feb 01 10:38:28 linux-9lzf worker[15778]: [warn] Failed to register at localhost - connection error: Connection refused - trying again in 10 seconds
Feb 01 10:38:30 linux-9lzf systemd[1]: openqa-worker-auto-restart@1.service: Sent signal SIGHUP to main process 15778 (worker) on client request.
Feb 01 10:38:30 linux-9lzf worker[15778]: [info] Received signal HUP
Feb 01 10:38:30 linux-9lzf systemd[1]: openqa-worker-auto-restart@1.service: Succeeded.
Feb 01 10:38:30 linux-9lzf systemd[1]: openqa-worker-auto-restart@1.service: Scheduled restart job, restart counter is at 1.
Feb 01 10:38:30 linux-9lzf systemd[1]: Stopped openQA Worker #1.
Feb 01 10:38:30 linux-9lzf systemd[1]: Starting openQA Worker #1...
Feb 01 10:38:30 linux-9lzf systemd[1]: Started openQA Worker #1.
Feb 01 10:38:31 linux-9lzf worker[17232]: [info] worker 1:

And also other active worker slots are affected, e.g.:

Feb 01 10:38:28 linux-9lzf worker[15987]: [warn] Failed to register at localhost - connection error: Connection refused - trying again in 10 seconds
Feb 01 10:38:30 linux-9lzf systemd[1]: openqa-worker-auto-restart@3.service: Sent signal SIGHUP to main process 15987 (worker) on client request.
Feb 01 10:38:30 linux-9lzf worker[15987]: [info] Received signal HUP
Feb 01 10:38:30 linux-9lzf systemd[1]: openqa-worker-auto-restart@3.service: Succeeded.
Feb 01 10:38:30 linux-9lzf systemd[1]: openqa-worker-auto-restart@3.service: Scheduled restart job, restart counter is at 1.
Feb 01 10:38:30 linux-9lzf systemd[1]: Stopped openQA Worker #3.
Feb 01 10:38:30 linux-9lzf systemd[1]: Starting openQA Worker #3...
Feb 01 10:38:30 linux-9lzf systemd[1]: Started openQA Worker #3.
Feb 01 10:38:31 linux-9lzf worker[17233]: [info] worker 3:

Apparently the postrun script of the already installed package is invoked on updates (and not the postrun script of the new package). Hence it does not work already on the first upgrade and still takes effect one last time when downgrading to a previous package version without this.

@Martchus Martchus marked this pull request as ready for review February 1, 2021 09:46
@Martchus Martchus merged commit 950166c into os-autoinst:master Feb 2, 2021
@Martchus Martchus deleted the reload-worker-on-update branch February 2, 2021 11:22
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.

None yet

2 participants