-
Notifications
You must be signed in to change notification settings - Fork 93
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
Add file-based locking to CRL modification #365
Comments
So I think @ralphbean nailed this on the first try:
I've written three naive fedmsg consumers for handling some QA stuff in the short term (ideally we should make them into taskotron tasks in the long term, I think), and we have a couple of hosts where two of them are running at the same time. It does seem like this only started happening after I started running two naive consumers at the same time. So I suspect Ralph may be right and this happens when both of them happen to try and do something to the same CRL cache file at the same time. Adding locking for writing to that file might be a good idea, I guess. I'm gonna see if I can revise my consumers to use the fedmsg hub (as recommended in the docs) instead of |
M2Crypto.X509.load_crl(crl)
I'm switching the misc. QA fedmsg consumers over to using fedmsg- hub, due to fedora-infra/fedmsg#365 . So we need to adjust how we install check-compose, install a config file to enable the consumer, and also set up the fedmsg base and hub roles on the openqa server boxes (which do the check-compose job ATM).
This also changes how they are cached in order to better handle expired or rotated CRLs/CAs. If the CA/CRL is a file, it is read into a cache and used until a message fails validation. At that point, the cache is invalidated and the CA/CRL is reloaded. If the message still fails validation, we mark it as invalid and continue. If the CA/CRL is a URL, the file is downloaded and cached in memory just like the file approach. It would be nice if the process halted when a fatal error was encountered (like the CRL being expired), but unfortunately there's no way to communicate that to moksha. Once we drop moksha we can do that with a set of fedmsg exceptions, but for now logging at the error level is the only thing we can do. fixes fedora-infra#481 fixes fedora-infra#365 Signed-off-by: Jeremy Cline <[email protected]>
This also changes how they are cached in order to better handle expired or rotated CRLs/CAs. If the CA/CRL is a file, it is read into a cache and used until a message fails validation. At that point, the cache is invalidated and the CA/CRL is reloaded. If the message still fails validation, we mark it as invalid and continue. If the CA/CRL is a URL, the file is downloaded and cached in memory just like the file approach. It would be nice if the process halted when a fatal error was encountered (like the CRL being expired), but unfortunately there's no way to communicate that to moksha. Once we drop moksha we can do that with a set of fedmsg exceptions, but for now logging at the error level is the only thing we can do. fixes fedora-infra#481 fixes fedora-infra#365 Signed-off-by: Jeremy Cline <[email protected]>
This also changes how they are cached in order to better handle expired or rotated CRLs/CAs. If the CA/CRL is a file, it is read into a cache and used until a message fails validation. At that point, the cache is invalidated and the CA/CRL is reloaded. If the message still fails validation, we mark it as invalid and continue. If the CA/CRL is a URL, the file is downloaded and cached in memory just like the file approach. It would be nice if the process halted when a fatal error was encountered (like the CRL being expired), but unfortunately there's no way to communicate that to moksha. Once we drop moksha we can do that with a set of fedmsg exceptions, but for now logging at the error level is the only thing we can do. fixes fedora-infra#481 fixes fedora-infra#365 Signed-off-by: Jeremy Cline <[email protected]>
This also changes how they are cached in order to better handle expired or rotated CRLs/CAs. If the CA/CRL is a file, it is read into a cache and used until a message fails validation. At that point, the cache is invalidated and the CA/CRL is reloaded. If the message still fails validation, we mark it as invalid and continue. If the CA/CRL is a URL, the file is downloaded and cached in memory just like the file approach. It would be nice if the process halted when a fatal error was encountered (like the CRL being expired), but unfortunately there's no way to communicate that to moksha. Once we drop moksha we can do that with a set of fedmsg exceptions, but for now logging at the error level is the only thing we can do. fixes fedora-infra#481 fixes fedora-infra#365 Signed-off-by: Jeremy Cline <[email protected]>
This also changes how they are cached in order to better handle expired or rotated CRLs/CAs. If the CA/CRL is a file, it is read into a cache and used until a message fails validation. At that point, the cache is invalidated and the CA/CRL is reloaded. If the message still fails validation, we mark it as invalid and continue. If the CA/CRL is a URL, the file is downloaded and cached in memory just like the file approach. It would be nice if the process halted when a fatal error was encountered (like the CRL being expired), but unfortunately there's no way to communicate that to moksha. Once we drop moksha we can do that with a set of fedmsg exceptions, but for now logging at the error level is the only thing we can do. fixes fedora-infra#481 fixes fedora-infra#365 Signed-off-by: Jeremy Cline <[email protected]>
This also changes how they are cached in order to better handle expired or rotated CRLs/CAs. If the CA/CRL is a file, it is read into a cache and used until a message fails validation. At that point, the cache is invalidated and the CA/CRL is reloaded. If the message still fails validation, we mark it as invalid and continue. If the CA/CRL is a URL, the file is downloaded and cached in memory just like the file approach. It would be nice if the process halted when a fatal error was encountered (like the CRL being expired), but unfortunately there's no way to communicate that to moksha. Once we drop moksha we can do that with a set of fedmsg exceptions, but for now logging at the error level is the only thing we can do. fixes fedora-infra#481 fixes fedora-infra#365 Signed-off-by: Jeremy Cline <[email protected]>
This also changes how they are cached in order to better handle expired or rotated CRLs/CAs. If the CA/CRL is a file, it is read into a cache and used until a message fails validation. At that point, the cache is invalidated and the CA/CRL is reloaded. If the message still fails validation, we mark it as invalid and continue. If the CA/CRL is a URL, the file is downloaded and cached in memory just like the file approach. It would be nice if the process halted when a fatal error was encountered (like the CRL being expired), but unfortunately there's no way to communicate that to moksha. Once we drop moksha we can do that with a set of fedmsg exceptions, but for now logging at the error level is the only thing we can do. fixes fedora-infra#481 fixes fedora-infra#365 Signed-off-by: Jeremy Cline <[email protected]>
This also changes how they are cached in order to better handle expired or rotated CRLs/CAs. If the CA/CRL is a file, it is read into a cache and used until a message fails validation. At that point, the cache is invalidated and the CA/CRL is reloaded. If the message still fails validation, we mark it as invalid and continue. If the CA/CRL is a URL, the file is downloaded and cached in memory just like the file approach. It would be nice if the process halted when a fatal error was encountered (like the CRL being expired), but unfortunately there's no way to communicate that to moksha. Once we drop moksha we can do that with a set of fedmsg exceptions, but for now logging at the error level is the only thing we can do. fixes fedora-infra#481 fixes fedora-infra#365 Signed-off-by: Jeremy Cline <[email protected]>
I'm running this fairly simple listener:
https://git.fedorahosted.org/cgit/fedora-qa.git/tree/check-compose/check-compose-fedmsg.in
to generate the 'compose check' emails. It's running on a Fedora 23 system, with:
python-fedmsg-core-0.16.2-1.fc23.noarch
m2crypto-0.22.5-2.fc23.x86_64
python-m2ext-0.1-7.fc23.x86_64
it seems like it runs fine for a while then, every so often, blows up at this point in
x509.py
functionvalidate()
:I can't immediately see why. When I look after seeing a crash,
/var/run/fedmsg/crl.pem
is there, and if I try, I can load it manually withimport M2Crypto; M2Crypto.X509.load_crl('/var/run/fedmsg/crl.pem')
.Here are the tracebacks I've got:
that one's shown up twice. This one's only happened once:
they're similar, but the first is
bad end line
, the second isno start line
.The text was updated successfully, but these errors were encountered: