Skip to content

Comments

Fix race condition when we init lambda#745

Closed
tiedotguy wants to merge 1 commit intomasterfrom
tdg/fix-lambda-race
Closed

Fix race condition when we init lambda#745
tiedotguy wants to merge 1 commit intomasterfrom
tdg/fix-lambda-race

Conversation

@tiedotguy
Copy link
Collaborator

There's a couple of problems here:

  1. We subscribe a telemetry endpoint before the service is ready. If we receive a flush to that endpoint, then we try to perform a flush and get an NPE.

  2. The access to the flusher is unprotected across multiple goroutines. We just use an RWMutex for this, because it's rarely accessed and doesn't need anything fancy.

  3. There's a race condition in the test because the nop write is (was) async.

There's a couple of problems here:

1. We subscribe a telemetry endpoint before the service is ready.  If we
   receive a flush to that endpoint, then we try to perform a flush and
   get an NPE.

2. The access to the flusher is unprotected across multiple goroutines.  We
   just use an RWMutex for this, because it's rarely accessed and doesn't
   need anything fancy.

3. There's a race condition in the test because the nop write is (was) async.
@tiedotguy tiedotguy requested a review from irisgve March 18, 2025 16:46
@atlassian-cla-bot
Copy link

Thank you for your submission! Like many open source projects, we ask that you sign our CLA (Contributor License Agreement) before we can accept your contribution.
If your email is listed below, please ensure that you sign the CLA with the same email address.

The following users still need to sign our CLA:
❌squizzling

Already signed the CLA? To re-check, try refreshing the page.

@tiedotguy
Copy link
Collaborator Author

Dangit wrong account

@tiedotguy tiedotguy closed this Mar 18, 2025
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.

2 participants