koji: do a connection check before other operations #172
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously we jump right into spawning a thread pool and farming out
some koji requests to threads.
Unfortunately, RHEL6 environments suffer from a thread-safety issue:
if the very first parsing of a SAN field from an SSL cert in the
lifetime of a process happens from multiple threads at once, corruption
can occur due to thread-unsafe lazy initialization in the pyasn1
library. This is etingof/pyasn1#53 .
See RHELDST-7454 for examples of the resulting crash.
Warming up from one thread before we start concurrent operations should
be an effective way to work around this and is arguably nicer behavior
anyway (e.g. trying to use an invalid koji URL will now give a more
understandable exception coming from a single thread). So let's do that.