Skip to content

NOJIRA-fix-flaky-receive-message-context-canceled-test - #1140

Merged
pchero merged 1 commit into
mainfrom
NOJIRA-fix-flaky-receive-message-context-canceled-test
Jul 25, 2026
Merged

NOJIRA-fix-flaky-receive-message-context-canceled-test#1140
pchero merged 1 commit into
mainfrom
NOJIRA-fix-flaky-receive-message-context-canceled-test

Conversation

@pchero

@pchero pchero commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Fix a data race in zmqsubhandler.receiveMessage that made Test_recevieMessage_context_canceled fail intermittently under go test -race (and occasionally without -race, when scheduling happened to line up the same way).

  • bin-api-manager: receiveMessage now selects on ctx.Done() while waiting to retry after EAGAIN, instead of an unconditional time.Sleep(1s). Previously a canceled context could go unnoticed for up to 1 second, racing with callers that Terminate() the zmq socket shortly after cancel().
  • bin-api-manager: Test_recevieMessage_context_canceled now waits on a done channel for the receiveMessage goroutine to actually return after cancel(), instead of a fixed 1s sleep, before the deferred sockSub.Terminate() runs.

Fix a data race in zmqsubhandler.receiveMessage that made
Test_recevieMessage_context_canceled fail intermittently under
go test -race (and occasionally without -race, when scheduling
happened to line up the same way).

- bin-api-manager: receiveMessage now selects on ctx.Done() while
  waiting to retry after EAGAIN, instead of an unconditional
  time.Sleep(1s). Previously a canceled context could go unnoticed
  for up to 1 second, racing with callers that Terminate() the zmq
  socket shortly after cancel().
- bin-api-manager: Test_recevieMessage_context_canceled now waits on
  a done channel for the receiveMessage goroutine to actually return
  after cancel(), instead of a fixed 1s sleep, before the deferred
  sockSub.Terminate() runs.
@pchero
pchero merged commit 91733ca into main Jul 25, 2026
2 of 3 checks passed
@pchero
pchero deleted the NOJIRA-fix-flaky-receive-message-context-canceled-test branch July 25, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant