git-bug/bridge/github
Michael Muré 7348fb9edb
github: fix data race when closing event channel
I believe the issue was twofold:

When done importing, the calling context is likely still valid, so if the output channel is not read enough and reach capacity, some event producer down the line can be blocked trying to send in that channel. When closing it, this send is still trying to proceed, which is illegal in go.

In rateLimitHandlerClient, there was a need to 2 different type of output channel: core.ExportResult and ImportEvent. To do so, the previous code was using a single channel type RateLimitingEvent and a series of goroutines to read/cast/send to the final channel. This could result in more async goroutine being stuck trying to send in an at-capacity channel. Instead, the code now use a simple synchronous callback to directly push to the final output channel. No concurrency needed anymore and the code is simpler.

Any of those fixes could have resolved the data race, but both fixes is more correct.
2022-06-05 15:13:49 +02:00
..
mocks Tests for the github bridge (#706) 2021-09-14 22:24:34 +02:00
client.go github: fix data race when closing event channel 2022-06-05 15:13:49 +02:00
config_test.go add github actions 2020-12-08 15:03:56 +01:00
config.go feature: Github bridge mutation rate limit (#694) 2021-09-14 22:22:28 +02:00
export_mutation.go [bug] add snapshot.GetCreateMetadata method 2019-06-30 15:33:27 +02:00
export_test.go github: attempt to fix a CI issue 2021-04-23 00:28:46 +02:00
export.go github: fix data race when closing event channel 2022-06-05 15:13:49 +02:00
github.go feature: Github bridge mutation rate limit (#694) 2021-09-14 22:22:28 +02:00
import_events.go github: fix data race when closing event channel 2022-06-05 15:13:49 +02:00
import_integration_test.go Tests for the github bridge (#706) 2021-09-14 22:24:34 +02:00
import_mediator.go github: fix data race when closing event channel 2022-06-05 15:13:49 +02:00
import_query.go Tests for the github bridge (#706) 2021-09-14 22:24:34 +02:00
import_test.go bug: migrate to the DAG entity structure! 2021-02-14 12:19:50 +01:00
import.go Merge pull request #727 from MichaelMure/rng-dynamics/fix-import-empty-title 2021-12-04 12:29:24 +01:00