-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sampling/pubsub: fix subscriber #7211
Merged
Merged
Conversation
This file contains 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
Break infinite loop in subscriber by setting a minimum bound on subsequent searches to the _seq_no returned by the previous search.
a79cefa
to
d4fcd1d
Compare
marclop
approved these changes
Feb 7, 2022
/test |
/test |
mergify bot
pushed a commit
that referenced
this pull request
Feb 8, 2022
Break infinite loop in subscriber by setting a minimum bound on subsequent searches to the _seq_no returned by the previous search. (cherry picked from commit 796fda2)
mergify bot
pushed a commit
that referenced
this pull request
Feb 8, 2022
Break infinite loop in subscriber by setting a minimum bound on subsequent searches to the _seq_no returned by the previous search. (cherry picked from commit 796fda2) # Conflicts: # changelogs/head.asciidoc
mergify bot
pushed a commit
that referenced
this pull request
Feb 8, 2022
Break infinite loop in subscriber by setting a minimum bound on subsequent searches to the _seq_no returned by the previous search. (cherry picked from commit 796fda2) # Conflicts: # changelogs/head.asciidoc
axw
added a commit
that referenced
this pull request
Feb 8, 2022
* sampling/pubsub: fix subscriber (#7211) Break infinite loop in subscriber by setting a minimum bound on subsequent searches to the _seq_no returned by the previous search. (cherry picked from commit 796fda2) # Conflicts: # changelogs/head.asciidoc * Delete head.asciidoc Co-authored-by: Andrew Wilkins <[email protected]>
axw
added a commit
that referenced
this pull request
Feb 8, 2022
* sampling/pubsub: fix subscriber (#7211) Break infinite loop in subscriber by setting a minimum bound on subsequent searches to the _seq_no returned by the previous search. (cherry picked from commit 796fda2) # Conflicts: # changelogs/head.asciidoc * Delete head.asciidoc Co-authored-by: Andrew Wilkins <[email protected]>
axw
added a commit
that referenced
this pull request
Feb 9, 2022
Break infinite loop in subscriber by setting a minimum bound on subsequent searches to the _seq_no returned by the previous search. (cherry picked from commit 796fda2) Co-authored-by: Andrew Wilkins <[email protected]>
Confirmed with bc2. Steps:
package main
import (
"os"
"go.elastic.co/apm"
"go.elastic.co/apm/transport"
)
func main() {
os.Setenv("ELASTIC_APM_SERVER_URL", "http://localhost:8200")
transport1, _ := transport.NewHTTPTransport()
tracer1, _ := apm.NewTracerOptions(apm.TracerOptions{
ServiceName: "svc1",
Transport: transport1,
})
defer tracer1.Flush(nil)
os.Setenv("ELASTIC_APM_SERVER_URL", "http://localhost:8201")
transport2, _ := transport.NewHTTPTransport()
tracer2, _ := apm.NewTracerOptions(apm.TracerOptions{
ServiceName: "svc2",
Transport: transport2,
})
defer tracer2.Flush(nil)
for i := 0; i < 500; i++ {
tx1 := tracer1.StartTransaction("tx1", "type")
span := tx1.StartSpan("span", "type", nil)
tx2 := tracer2.StartTransactionOptions("tx2", "type", apm.TransactionOptions{
TraceContext: span.TraceContext(),
})
tx2.End()
span.End()
tx1.End()
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport-7.17
Automated backport with mergify to the 7.17 branch
backport-8.0
Automated backport with mergify
backport-8.1
Automated backport with mergify
test-plan
test-plan-ok
v8.1.0
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.
Motivation/summary
The tail-based sampling subscriber can enter an infinite loop when one of the sampled traces indices contains more than 1000 documents. In this case, we never update the _seq_no filter and continuously issue the same search in an infinite loop.
We fix this by by setting the minimum bound on subsequent searches to the _seq_no returned by the previous search.
Checklist
- [ ] Update package changelog.yml (only if changes toapmpackage
have been made)- [ ] Documentation has been updatedHow to test these changes
See #6642 (comment)
Related issues
Closes #6639
Closes #6642