hook concurrency: more hook granularity #2
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
heiko/cert-proxy#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently there is one hook which is run for each certificate which is updated. These hooks may run in parallel which is generally desirable but may cause service restart failure at the end of the hook. This is very likely to happen when another instance of the hook is writing to a certificate file which is also used by the service which is to be restarted in the hook.
This can be worked around by using a lock file in the hook, but this will serialize hook execution of course which is counterproductive if hook parallelization was done on purpose.
Ideally there would be one (post) or two (pre and post) or even more hooks per certificate and one global hook which is run before any per certificate hook is run and another one which is run after all per certificate hooks finished. The hook script runner could identify this global phases to the hook script by setting the
DOMAINenvironment variable to the valueglobalor by setting the environment variableGLOBAL.more hook granularityto hook concurrency: more hook granularityWhat about (as in the recent commit)
New option
-shared-hook <hook>, which then calls<hook>after all other hooks are done, as:This is compatible with the hooks we have already.
BTW, the hooks run serialized (at least it is supposed to do so), but while a hook is running, another thread of the cert-proxy-client may update one of the other certificates.