consulate
consulate copied to clipboard
Consul kv race condition 'Error setting "$key" (200)'
There appears to be some sort of race condition when setting/deleting a key from two different threads/processes. For example:
import consulate
import threading
def update():
try:
session.kv['test'] = 'true'
del session.kv['test']
except Exception as e:
print(e)
session = consulate.Session()
threading.Thread(target=update).start()
threading.Thread(target=update).start()
will produce:
'Error setting "test" (200)'
Consul is running in a local docker container. Is the the expected behavior/why does consul return a 200 with empty body?