Repository navigation
[probes.external] Fix logical race condition in external server probe handling - #744
Merged
Merged
Conversation
Contributor
|
Thanks @apolcyn! Just to summarize for myself: race condition occurs when we are able to read the reply, but send channel is not closed so we come back to reading the reply channel which will not yield anymore as reply has already been read. That will cause goroutine to get blocked until timeout. That makes sense to me. I'll take a further lok. |
rishabhgargsde
pushed a commit
to rishabhgargsde/cloudprober
that referenced
this pull request
Dec 24, 2024
(the file name is different upstream) This fixes a source of spurious "context deadline exceeded" logs when using external probes: https://screenshot.googleplex.com/ySKm57nNok2q7BR https://b.corp.google.com/issues/284176051#comment55 PiperOrigin-RevId: 646227817
rishabhgargsde
pushed a commit
to rishabhgargsde/cloudprober
that referenced
this pull request
Dec 24, 2024
(the file name is different upstream) This fixes a source of spurious "context deadline exceeded" logs when using external probes: https://screenshot.googleplex.com/ySKm57nNok2q7BR https://b.corp.google.com/issues/284176051#comment55 PiperOrigin-RevId: 646227817
rishabhgargsde
pushed a commit
to rishabhgargsde/cloudprober
that referenced
this pull request
Dec 30, 2024
(the file name is different upstream) This fixes a source of spurious "context deadline exceeded" logs when using external probes: https://screenshot.googleplex.com/ySKm57nNok2q7BR https://b.corp.google.com/issues/284176051#comment55 PiperOrigin-RevId: 646227817
rishabhgargsde
pushed a commit
to rishabhgargsde/cloudprober
that referenced
this pull request
Dec 30, 2024
(the file name is different upstream) This fixes a source of spurious "context deadline exceeded" logs when using external probes: https://screenshot.googleplex.com/ySKm57nNok2q7BR https://b.corp.google.com/issues/284176051#comment55 PiperOrigin-RevId: 646227817
rishabhgargsde
pushed a commit
to rishabhgargsde/cloudprober
that referenced
this pull request
Dec 30, 2024
(the file name is different upstream) This fixes a source of spurious "context deadline exceeded" logs when using external probes: https://screenshot.googleplex.com/ySKm57nNok2q7BR https://b.corp.google.com/issues/284176051#comment55 PiperOrigin-RevId: 646227817
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently there is a logical race condition as follows:
Suppose there is an external probe running in SERVER mode, with only one
target.cloudprober sends the single request
If the external probe server responds quickly enough, cloudprober can read the reply, but then when it checks
sendDoneCh, it might not be closed yet.cloudprober's reader go-routine goes back to blocking on the select statement.
Now the parent go-routine closes
sendDoneCh.At this point, the reader go-routine will remain blocked on the top select statement.
It will remain there until the context times out.
The impact of this bug is probably not catastrophic in most cases, but it causes a bunch of spurious "deadline exceeded" error logs from here if nothing else.