agola/internal/services/configstore/readdb
Simone Gotti 85876310af readdb: fix deadlock in Run method
In runservice readdb Run method we could end with a deadlock if two of the
goroutines that call HandleEvents.* try to write to the errCh at the same
time before the errCh is read. If this happens one of the two will be blocked on
writing to the channel but the read won't happen since it'll blocked by
wg.Wait().

Fix this doing:
* use a buffered channel large as the number of executed goroutines.
* create a new errCh at every loop (so we'll ignore later errors after the first
one)

Note: we could also use a non blocking send to avoid this situation but we
should also start the wg.Wait before the goroutines or earlier errors could be
lost causing another kind of hang.
2019-07-23 14:56:26 +02:00
..
create.go configstore: add parenttype to related tables 2019-07-09 10:16:45 +02:00
org.go *: use vanity url 2019-07-01 11:40:20 +02:00
project.go configstore: add parenttype to related tables 2019-07-09 10:16:45 +02:00
projectgroup.go configstore: add parenttype to related tables 2019-07-09 10:16:45 +02:00
readdb.go readdb: fix deadlock in Run method 2019-07-23 14:56:26 +02:00
remotesource.go *: use vanity url 2019-07-01 11:40:20 +02:00
resolve.go *: use vanity url 2019-07-01 11:40:20 +02:00
secret.go configstore: add parenttype to related tables 2019-07-09 10:16:45 +02:00
user.go configstore: fix linter errors 2019-07-02 14:46:00 +02:00
variable.go configstore: add parenttype to related tables 2019-07-09 10:16:45 +02:00