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
fix(federation): re-add RequestSharedSecret job if necessary #44848
base: master
Are you sure you want to change the base?
Conversation
fighting another race condition with federated server setup Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it works, code looks good.
|
||
$hasJob = false; | ||
foreach ($this->jobList->getJobsIterator(RequestSharedSecret::class, 1, 0) as $job) { | ||
$hasJob = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this could be for another URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. Shall compare that argument then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And then either loop over all or get chunks until you found it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I would have looked for the hasJob, but the timestamp ruins it.
fighting another race condition with federated server setup
Summary
@Fenn-CS and I saw another race condition when trying to set up trusted servers. Even when running cron-jobs hand-pickedly, we could end up in state where the
requestSharedSecret
endpoint is called, claims to We will initiate the exchange of the shared secret, but does not have the appropriate Job in its list anymore.The change queries the joblist to see whether this one is actually scheduled, and adds it back if it is not the case.
Checklist