Skip to content
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

ddtrace/tracer: simplify channels #498

Merged
merged 2 commits into from
Sep 19, 2019
Merged

ddtrace/tracer: simplify channels #498

merged 2 commits into from
Sep 19, 2019

Conversation

gbbr
Copy link
Contributor

@gbbr gbbr commented Sep 18, 2019

This change slightly simplifies concurrency, moves some test methods to
the test files, improves naming to be more consistent and adds more
documentation.

Eventually, what is now flushChan can also go away, but it's a bigger piece
of work that requires a lot of test rewriting.

@gbbr gbbr added the enhancement quick change/addition that does not need full team approval label Sep 18, 2019
@gbbr gbbr added this to the 1.18.0 milestone Sep 18, 2019
This change slightly simplifies concurrency, moves some test methods to
the test files, improves naming to be more consistent and adds more
documentation.
ddtrace/tracer/tracer.go Outdated Show resolved Hide resolved
Copy link
Contributor

@cgilmour cgilmour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The Chan suffix is better than what was there originally.
It'll be nice when flushChan can be refactored out in the future.

@gbbr gbbr merged commit dd441a6 into v1 Sep 19, 2019
@gbbr gbbr deleted the gbbr/simplify-channels branch September 19, 2019 08:41
@@ -289,7 +292,7 @@ func (t *tracer) Extract(carrier interface{}) (ddtrace.SpanContext, error) {
}

// flush will push any currently buffered traces to the server.
func (t *tracer) flush() {
func (t *tracer) flushPayload() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment should be updated to flushPayload.

gbbr added a commit that referenced this pull request Jan 15, 2020
During a previous change released as part of v1.20.0 in PR #498, the
flush channel was accidentally made blocking. This would cause a
deadlock on occasion when flushing after the payload was full.

Tests failed to catch this problem because they were not using the
constructor and instead had their own, which was made correctly. This
change also addresses that problem and removes the constructor from the
tests, now correctly reproducing the problem.
gbbr added a commit that referenced this pull request Jan 15, 2020
During a previous change released as part of v1.20.0 in PR #498, the
flush channel was accidentally made blocking. This would cause a
deadlock on occasion when flushing after the payload was full.

Tests failed to catch this problem because they were not using the
constructor and instead had their own, which was made correctly. This
change also addresses that problem and removes the constructor from the
tests, now correctly reproducing the problem.
gbbr added a commit that referenced this pull request Jan 15, 2020
During a previous change released as part of v1.20.0 in PR #498, the
flush channel was accidentally made blocking. This would cause a
deadlock on occasion when flushing after the payload was full.

Tests failed to catch this problem because they were not using the
constructor and instead had their own, which was made correctly. This
change also addresses that problem and removes the constructor from the
tests, now correctly reproducing the problem.
gbbr added a commit that referenced this pull request Jan 15, 2020
During a previous change released as part of v1.20.0 in PR #498, the
flush channel was accidentally made blocking. This would cause a
deadlock on occasion when flushing after the payload size became large.

Tests failed to catch this problem because they were not using the
constructor and instead had their own incorrect constructor. This
change also addresses that problem so that tests would now correctly
catch the issue.
mingrammer pushed a commit to mingrammer/dd-trace-go that referenced this pull request Dec 22, 2020
This change slightly simplifies concurrency, moves some test methods to
the test files, improves naming to be more consistent and adds more
documentation.
mingrammer pushed a commit to mingrammer/dd-trace-go that referenced this pull request Dec 22, 2020
During a previous change released as part of v1.20.0 in PR DataDog#498, the
flush channel was accidentally made blocking. This would cause a
deadlock on occasion when flushing after the payload size became large.

Tests failed to catch this problem because they were not using the
constructor and instead had their own incorrect constructor. This
change also addresses that problem so that tests would now correctly
catch the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement quick change/addition that does not need full team approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants