zammad / zammad

Zammad is a web based open source helpdesk/customer support system
https://zammad.org
GNU Affero General Public License v3.0
4.43k stars 752 forks source link

Improve app restart handling (after object field related schema changes) #5377

Open mgruner opened 3 days ago

mgruner commented 3 days ago

Used Zammad Version

6.3

Environment

Actual behaviour

When making changes to core objects like adding new Ticket fields, schema changes in the database have to be executed. After that, a restart of all application server processes is needed. This can be automated on package and source installations (via APP_RESTART_CMD), but does not work in containerized environments (hacks are possible for docker, but go against security considerations).

Additionally, for the manual restarts, there is a time of inconsistency when the schema was already changed, but processes like scheduler not yet restarted - which can lead to inconsistent behaviour.

Expected behaviour

Zammad should be changed in a way that these restarts are either not needed, or work correctly on any installation method in an automated way, reducing times of inconsistent code state to a minimum.

Steps to reproduce the behaviour

Support Ticket

No response

I'm sure this is a bug and no feature request or a general question.

yes

mgruner commented 3 days ago

Ideas

We should evaluate first if the restarts are actually required, or if on the server a refresh of the model objects (reset_column_information) would be sufficient, like we do it in the migrations.

If Restart is Required

We could consider informing all processes about a required change (e.g. through a hidden setting with a number that is incremented). All processes will detect such a change and respond to it by terminating. It's the responsibility of the process manager (systemd, docker compose, kubernetes) to bring up new processes instead.

If Reload is Enough

All processes are notified about the change (see above), but they don't terminate but instead only refresh their model data and other relevant parts of the API on the back end side. The new mobile and desktop front ends don't need a restart anyway, legacy app still needs a browser reload.

dominikklein commented 3 days ago

The new mobile and desktop front ends don't need a restart anyway

Why do you think the new stack needs no reload?

mgruner commented 3 days ago

I was under the impression, because our graphql schema is static and does not change based on the object fields. Is that not correct?

dominikklein commented 3 days ago

No, because form fields are build based on the object attributes which are returned from the server. And the attributes are fetched once. So after a new attribute was added/changed it's no longer up to date from this perspecctive. For sure we could add some subscription for that, but at least it's currently not implemented.

mgruner commented 3 days ago

Ok, but that would work without a full app reload, hopefully.