Skip to content

tracing: Zipkin: do cleanup on tracer destruction in order to support dynamic (re-)configuration#10349

Merged
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
yskopets:feature/do-cleanup-on-zipkin-tracer-destruction
Mar 24, 2020
Merged

tracing: Zipkin: do cleanup on tracer destruction in order to support dynamic (re-)configuration#10349
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
yskopets:feature/do-cleanup-on-zipkin-tracer-destruction

Conversation

@yskopets
Copy link
Member

@yskopets yskopets commented Mar 12, 2020

Description: do cleanup on tracer destruction in order to support dynamic (re-)configuration
Risk Level: Low
Testing: unit tests
Docs Changes: N/A
Release Notes: N/A

Context:

Motivation:

  • since Zipkin tracer allows multiple concurrent in-flight requests to the collector, we need to keep track of all of them and cancel them if tracer gets removed

@yskopets yskopets force-pushed the feature/do-cleanup-on-zipkin-tracer-destruction branch 4 times, most recently from 138d721 to dc90426 Compare March 12, 2020 11:43
@yskopets
Copy link
Member Author

@alyssawilk @jmarantz I will split this PR into 2:

  1. refactoring of Http::AsyncClient::Callbacks and introduction of Http::AsyncClientRequestTracker
  2. changes to Zipkin tracer

@yskopets yskopets force-pushed the feature/do-cleanup-on-zipkin-tracer-destruction branch 4 times, most recently from 2c2f0e4 to 7900a30 Compare March 12, 2020 15:15
@yskopets yskopets marked this pull request as ready for review March 12, 2020 15:18
@yskopets
Copy link
Member Author

@jmarantz
Please notice that only the last commit is unique to this PR.
The remaining commits belong to #10358 and #10359.

@yskopets yskopets force-pushed the feature/do-cleanup-on-zipkin-tracer-destruction branch 4 times, most recently from 317a9e6 to 11ff67f Compare March 16, 2020 12:44
@yskopets yskopets force-pushed the feature/do-cleanup-on-zipkin-tracer-destruction branch 2 times, most recently from 790b7ca to 0563154 Compare March 16, 2020 23:49
@jmarantz
Copy link
Contributor

Clarification: this PR is no longer intended for review, is that right?

/wait

@yskopets
Copy link
Member Author

@jmarantz

Yes, please wait.

I will ping you once #10358 has been merged.

… dynamic (re-)configuration

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
@yskopets yskopets force-pushed the feature/do-cleanup-on-zipkin-tracer-destruction branch from 0563154 to aaa4aa5 Compare March 23, 2020 20:56
@yskopets
Copy link
Member Author

@jmarantz It is now ready for review. All dependant PRs have been merged.

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
.httpAsyncClientForCluster(driver_.cluster()->name())
.send(std::move(message), *this,
Http::AsyncClient::RequestOptions().setTimeout(std::chrono::milliseconds(timeout)));
auto* request = driver_.clusterManager()
Copy link
Contributor

Choose a reason for hiding this comment

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

please use an explicit type here.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

const CollectorInfo collector_;
SpanBufferPtr span_buffer_;
// Track active HTTP requests to be able to cancel them on destruction.
Http::AsyncClientRequestTracker active_requests_;
Copy link
Contributor

Choose a reason for hiding this comment

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

qq: is this class instantiated per-thread? Or if it's shared do we need to guard with a mutex?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, separate instance per thread

  tls_->set([this, collector, &random_generator, trace_id_128bit, shared_span_context](
                Event::Dispatcher& dispatcher) -> ThreadLocal::ThreadLocalObjectSharedPtr {
    ...
        ReporterImpl::NewInstance(std::ref(*this), std::ref(dispatcher), collector));
    ...
  });

@jmarantz
Copy link
Contributor

/wait

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
Copy link
Contributor

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

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

Thanks!

@envoyproxy/senior-maintainers

@mattklein123 mattklein123 self-assigned this Mar 24, 2020
@mattklein123 mattklein123 merged commit c73ccd1 into envoyproxy:master Mar 24, 2020
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.

3 participants