Fix possible race condition applying schemas
Found an instance where two of these fired too close together, and caused a fatal error. Use a write lock, and then catch the schema.apply function in case it fails anyways.
This commit is contained in:
@ -197,7 +197,9 @@ def entrypoint():
|
||||
os.execv(sys.argv[0], sys.argv)
|
||||
|
||||
# Validate the schema
|
||||
pvcnoded.util.zookeeper.validate_schema(logger, zkhandler)
|
||||
with zkhandler.writelock("base.schema.version"):
|
||||
sleep(0.5)
|
||||
pvcnoded.util.zookeeper.validate_schema(logger, zkhandler)
|
||||
|
||||
# Define a cleanup function
|
||||
def cleanup(failure=False):
|
||||
|
Reference in New Issue
Block a user