pomerium/pkg/storage/redis
Cuong Manh Le f4cb5ea6e9
pkg/storage/redis: fix multiple data race (#1210)
There are two data race in current code:

 - Call to close pub sub conn and renew pub sub conn
 - Call to close notify channel and send data to it

Fixing them by:

 - Moving pub sub conn creation/renew in the doNotifyLoop
 - Add a lock to guard before close/send data to channel, and also add
 another check for context was done at the beginning of notify loop.

Verifying by running:

	for _ in {1..100}; do
	  go test -race -count=1 ./pkg/storage/redis/...
	done

with no failure.
2020-08-05 22:35:14 +07:00
..
testdata pkg/storage/redis: add redis TLS support (#1163) 2020-07-31 19:37:23 +07:00
option.go pkg/storage/redis: add redis TLS support (#1163) 2020-07-31 19:37:23 +07:00
redis.go pkg/storage/redis: fix multiple data race (#1210) 2020-08-05 22:35:14 +07:00
redis_test.go pkg/storage/redis: add redis TLS support (#1163) 2020-07-31 19:37:23 +07:00