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

gcp-o11y: add sleep in Observability close() #9972

Merged
merged 3 commits into from Mar 22, 2023

Conversation

DNVindhya
Copy link
Contributor

@DNVindhya DNVindhya commented Mar 21, 2023

This PR adds sleep in close() for metrics and/or traces to be flushed before closing observability.

Currently sleep is set to 2 * [Metrics export interval (30 secs)].

CC @sanjaypujare @ejona86
CC @stanley-cheung : this might alter inter-op tests results

Thread.sleep(
TimeUnit.MILLISECONDS.convert(2 * METRICS_EXPORT_INTERVAL, TimeUnit.SECONDS));
} catch (InterruptedException e) {
logger.log(Level.SEVERE, "Caught exception during sleep", e);
Copy link
Member

Choose a reason for hiding this comment

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

Add Thread.currentThread().interrupt()

@ejona86 ejona86 merged commit 783de5d into grpc:master Mar 22, 2023
3 checks passed
@DNVindhya DNVindhya deleted the gcp-o11y-sleep-for-flush branch March 22, 2023 18:44
ejona86 pushed a commit that referenced this pull request Mar 22, 2023
… in close() (#9977)

After #9972, the `sleep()` is done inside Observability `close()`, we can remove this `sleep()` in the Observability Interop test binary.
ejona86 pushed a commit to ejona86/grpc-java that referenced this pull request Mar 22, 2023
… in close() (grpc#9977)

After grpc#9972, the `sleep()` is done inside Observability `close()`, we can remove this `sleep()` in the Observability Interop test binary.
ejona86 pushed a commit that referenced this pull request Mar 23, 2023
… in close() (#9977)

After #9972, the `sleep()` is done inside Observability `close()`, we can remove this `sleep()` in the Observability Interop test binary.
larry-safran pushed a commit to larry-safran/grpc-java that referenced this pull request Mar 23, 2023
… in close() (grpc#9977)

After grpc#9972, the `sleep()` is done inside Observability `close()`, we can remove this `sleep()` in the Observability Interop test binary.
larry-safran pushed a commit to larry-safran/grpc-java that referenced this pull request Mar 29, 2023
… in close() (grpc#9977)

After grpc#9972, the `sleep()` is done inside Observability `close()`, we can remove this `sleep()` in the Observability Interop test binary.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants