Make sure to close the database connection before forking in verbs
This prevents a bug with the postgres driver from breaking the verbs Fixes https://jira.coreos.com/browse/QS-68
This commit is contained in:
parent
4a5626e64b
commit
25248a8c35
1 changed files with 5 additions and 0 deletions
|
@ -250,6 +250,11 @@ def _repo_verb(namespace, repository, tag, verb, formatter, sign=False, checker=
|
|||
|
||||
logger.debug('Building and returning derived %s image %s', verb, derived_image.ref)
|
||||
|
||||
# Close the database connection before any process forking occurs. This is important because
|
||||
# the Postgres driver does not react kindly to forking, so we need to make sure it is closed
|
||||
# so that each process will get its own unique connection.
|
||||
database.close_db_filter(None)
|
||||
|
||||
# Calculate a derived image ID.
|
||||
derived_image_id = hashlib.sha256(repo_image.image_id + ':' + verb).hexdigest()
|
||||
|
||||
|
|
Reference in a new issue