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

docs(component): improves the documentation #2504

Merged

Conversation

jcchavezs
Copy link
Contributor

@jcchavezs jcchavezs commented Feb 17, 2021

Clarifies that components should not accept anymore data on shutdown

Ping @bogdandrutu

Closes #2481

@jcchavezs jcchavezs requested a review from a team February 17, 2021 13:51
@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #2504 (f21baa1) into main (846b971) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2504   +/-   ##
=======================================
  Coverage   91.76%   91.76%           
=======================================
  Files         266      266           
  Lines       15111    15111           
=======================================
  Hits        13866    13866           
- Misses        866      867    +1     
+ Partials      379      378    -1     
Impacted Files Coverage Δ
testutil/testutil.go 81.60% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 846b971...f21baa1. Read the comment docs.

Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

@@ -37,7 +37,8 @@ type Component interface {
// Create a new context from the context.Background() for long-running operations.
Start(ctx context.Context, host Host) error

// Shutdown is invoked during service shutdown.
// Shutdown is invoked during service shutdown. After Shutdown() is called, if the component accept data in
Copy link
Member

Choose a reason for hiding this comment

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

Shutdown signals the component to stop accepting data and to clean up the resources in use, as the collector is being stopped.

Copy link
Member

Choose a reason for hiding this comment

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

If we want to clarify this we also need to tell that any internally stored pdata must be drained, propagated further to the pipeline to the next consumer (or exported out of the Collector if the component is exporter) before Shutdown returns.
"Clean up the resources" hints to that but I think it is not sufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jpkrohling I would remove the "as the collector is being stopped" that sounds to me too much information from upstream. How about saying "as the processor is being decommissioned"?

@tigrannajaryan this is outlined in https://github.com/open-telemetry/opentelemetry-collector/pull/2504/files#diff-6f065ffd54f98081ffd548c200264f761067d883b72b315c01ac28ef5a8fce47R45-R46 but I like the "before Shutdown returns" part. I think I should add it.

@tigrannajaryan tigrannajaryan merged commit 0ed7a4c into open-telemetry:main Feb 23, 2021
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.

Clarify whether processors should accept data or not after shutdown
4 participants