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

Allow acquire _CrossProcessLock on owner kill #3071

Closed

Conversation

stanislavlevin
Copy link
Contributor

For now the lock can be acquired only if the previous owner has
released filelock or on timeout (1h).
There are cases when the owner dies before release the lock (e.g. on upgrade).
This leads to lock-waiting for expire date by all the other processes
being synced.

An additional check for owner status was added. If a previous owner
is dead then an awaiting process becomes a new lock owner.

Fixes: https://pagure.io/freeipa/issue/7924

For now the lock can be acquired only if the previous owner has
released filelock or on timeout (1h).
There are cases when the owner dies before release the lock(e.g. upgrade).
This leads to lock-waiting for expire date by all the other processes
being synced.

An additional check for owner status was added. If a previous owner
is dead then an awaiting process becomes a new lock owner.

Fixes: https://pagure.io/freeipa/issue/7924
Signed-off-by: Stanislav Levin <slev@altlinux.org>
@tiran
Copy link
Member

tiran commented Apr 25, 2019

@frasertweedale please take a look

@stanislavlevin I think this is logic is not correct. There are places where a process acquires a lock and then exists, e.g. stop_pkicad. I don't fully understand the locking logic. Fraser is your man.

@flo-renaud
Copy link
Contributor

Hi @stanislavlevin
as the name implies, the lock is not tied to a given process. For instance, during the RA certificate renewal, certmonger launches a pre-save command that takes the lock (renew_ra_cert_pre), then saves the certificate and finally launches a post-save command that releases the lock (renew_ra_cert).
In this case, the lock does not store the PID of the renew_ra_cert_pre process but rather its name ('renew_ra_cert') in the owner attribute.
So it is completely legit to have a 'dead' owner and the proposed fix is not suitable.

Which error did you actually see on upgrade?

@stanislavlevin
Copy link
Contributor Author

mmm, I see.
There is no error, certmonger just stuck on 'SUBMITTING' and it's not obvious why (from admin/user point of view) and what to do.

@stanislavlevin
Copy link
Contributor Author

@flo-renaud , ok, let's close this PR and move the discussion to the opened issue (https://pagure.io/freeipa/issue/7924)

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.

4 participants