Open
Description
Only affects first run of worker against your DB, so if you already have worker running you're fine.
If you run 10 graphile-worker
instances against a clean database all at the same time there's a good chance that in this code:
Lines 117 to 137 in 436e299
two or more will generate the requisite 42P01
/42703
error, and both will attempt to install the schema, and only one can succeed. The other will throw an error and exit.
There's two bugs here:
- the
installSchema
should be wrapped withtry/catch
so that errors thrown there will trigger a retry of the whole loop - there's no
sleep()
, so it'll instantly retry which can be painful - we should use randomized back-off
Activity