Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

listener: Protect batch buffer from concurrent access #77

Merged
merged 1 commit into from
May 15, 2018

Conversation

mjs
Copy link
Contributor

@mjs mjs commented May 15, 2018

The HTTP listener uses concurrent HTTP handlers which were modifying the batch buffer without synchronisation. This resulted in data races and corrupt output from the listener. The test added in this change would reliably result in corrupt output before the mutex was added.

The mutex is not required or used for the UDP listener as there is only one goroutine in that case.

The HTTP listener uses concurrent HTTP handlers which were modifying
the batch buffer without synchronisation. This resulted in data races
and corrupt output from the listener. The test added in this change
would reliably result in corrupt output before the mutex was added.

The mutex is not required or used for the UDP listener as there is
only one goroutine in that case.
@mjs mjs requested a review from oplehto May 15, 2018 05:54
@oplehto oplehto merged commit 693993a into jumptrading:master May 15, 2018
@mjs mjs deleted the http-listener-concurrency branch June 26, 2018 02:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants