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

Add a Close method to storage extension's Client interface, and use it #3506

Merged
merged 4 commits into from
May 26, 2021

Conversation

djaglowski
Copy link
Member

Addresses issues identified in review of potential port to collector core.

internal/stanza/go.mod Outdated Show resolved Hide resolved
extension/storage/filestorage/Makefile Show resolved Hide resolved
@djaglowski djaglowski marked this pull request as ready for review May 25, 2021 12:55
@djaglowski djaglowski requested a review from a team May 25, 2021 12:55
Comment on lines -62 to -64
for _, client := range lfs.clients {
client.close()
}
Copy link
Member

@tigrannajaryan tigrannajaryan May 25, 2021

Choose a reason for hiding this comment

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

It is not clear how we can do garbage collection after this change. As TODO says we were planning to delete everything that does not have a client. Now that we no longer track clients how do we do that? TODO now seems irrelevant/impossible.

Copy link
Member Author

@djaglowski djaglowski May 25, 2021

Choose a reason for hiding this comment

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

In the future, I think a mechanism very similar to the previous design should work for cleanup. Each time GetClient is called, we can capture the filename associated with the client that is created. When the extension shuts down, we can use the same logic that we had intended.

Copy link
Member

Choose a reason for hiding this comment

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

Every component that gets a client should close it when they are shutdown, so not sure if this extension should do the cleanup.

@tigrannajaryan
Copy link
Member

Please resolve the conflict.

Comment on lines -62 to -64
for _, client := range lfs.clients {
client.close()
}
Copy link
Member

Choose a reason for hiding this comment

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

Every component that gets a client should close it when they are shutdown, so not sure if this extension should do the cleanup.

@bogdandrutu bogdandrutu merged commit c31f30c into open-telemetry:main May 26, 2021
alexperez52 referenced this pull request in open-o11y/opentelemetry-collector-contrib Aug 18, 2021
Based on the current experience, they are not necessary.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
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