Project

General

Profile

Actions

Bug #34602

closed

Detect plugin installation and trigger Puma restart

Added by Evgeni Golov about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-

Description

This is a follow up of https://community.theforeman.org/t/when-should-the-installer-restart-puma/26162

To recap the issue: when you install or update a plugin today, puma needs to be restarted to load the new code, but this only happens if the installer detects this situation.
The detection, today, only detects two cases: a plugin was installed by the installer or the plugin got updated via packaging and has a new migration available.

A lot of .z plugin updates don't carry new migrations, and thus go undetected and break things (like views that try to load files that are gone and similar)

In the above discussion, we came to the conclusion we should try to detect these cases better and trigger a puma restart.

There are different proposals, but all have one in common: a package installation/upgrade somewhow marks the system as "dirty" ("changed") and this can be used as a flag for the restart.

There is an interesting feature in systemd (https://fedoraproject.org/wiki/Changes/Restart_services_at_end_of_rpm_transaction) that could be used for that, but it only would work on EL9 and other "modern" installs, while we also need to support "legacy" systems like EL8.

So the probably best next thing would be to have packaging touch a file somewhere (rails tmp?) and the installer ensuring this file as absent with a notification towards the service definition, thus triggering a restart.
The file in rails tmp also could be used as a source for UI notifications about a needed restart.


Related issues 1 (1 open0 closed)

Related to Installer - Bug #36682: installer fails to call Foreman_host when plugins were updated via packages but service was not restartedNewActions
Actions #1

Updated by The Foreman Bot almost 2 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Evgeni Golov
  • Pull request https://github.com/theforeman/foreman-packaging/pull/7853 added
Actions #2

Updated by The Foreman Bot almost 2 years ago

  • Pull request https://github.com/theforeman/puppet-foreman/pull/1046 added
Actions #3

Updated by The Foreman Bot almost 2 years ago

  • Pull request https://github.com/theforeman/foreman-packaging/pull/7855 added
Actions #4

Updated by The Foreman Bot almost 2 years ago

  • Fixed in Releases 3.3.0 added
Actions #5

Updated by Evgeni Golov almost 2 years ago

  • Status changed from Ready For Testing to Closed
Actions #6

Updated by Amit Upadhye almost 2 years ago

  • Subject changed from detect plugin installation and trigger puma restart to Detect plugin installation and trigger Puma restart
Actions #7

Updated by Evgeni Golov 8 months ago

  • Related to Bug #36682: installer fails to call Foreman_host when plugins were updated via packages but service was not restarted added
Actions

Also available in: Atom PDF