Skip to content

Commit

Permalink
atlas: fix duplicate flush on shutdown (#1071)
Browse files Browse the repository at this point in the history
If it was in the process of sending data when the registry
is shutdown, then it could result in the same time interval
getting sent multiple times. Synchronizing the methods is
a simple solution for now as only a single thread should
be performing a send at a given time.
  • Loading branch information
brharrington committed Aug 11, 2023
1 parent 334a51a commit ce22fc4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private Timer publishTaskTimer(String id) {
return debugRegistry.timer(PUBLISH_TASK_TIMER, "id", id);
}

void sendToAtlas() {
synchronized void sendToAtlas() {
publishTaskTimer("sendToAtlas").record(() -> {
if (config.enabled()) {
long t = lastCompletedTimestamp(stepMillis);
Expand Down Expand Up @@ -272,7 +272,7 @@ void sendToAtlas() {
});
}

void sendToLWC() {
synchronized void sendToLWC() {
publishTaskTimer("sendToLWC").record(() -> {
long t = lastCompletedTimestamp(lwcStepMillis);
//if (config.enabled() || config.lwcEnabled()) {
Expand Down

0 comments on commit ce22fc4

Please sign in to comment.