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

Timer task is disposed due to restartTimerOnMaxSize leading to data loss #806

Open
OrezzerO opened this issue Jan 10, 2025 · 0 comments · May be fixed by #807
Open

Timer task is disposed due to restartTimerOnMaxSize leading to data loss #806

OrezzerO opened this issue Jan 10, 2025 · 0 comments · May be fixed by #807

Comments

@OrezzerO
Copy link

Steps to reproduce:

  1. Submit data fast enough,
  2. If timer is running while buffer is full ,timer task will be disposed.

We can see it in :

public void onNext(T t) {
U b;
synchronized (this) {
b = buffer;
if (b == null) {
return;
}
b.add(t);
if (b.size() < maxSize) {
return;
}
buffer = null;
producerIndex++;
}
if (restartTimerOnMaxSize) {
timer.dispose();
}
fastPathOrderedEmitMax(b, false, this);
try {
b = Objects.requireNonNull(bufferSupplier.get(), "The supplied buffer is null");
} catch (Throwable e) {
Exceptions.throwIfFatal(e);
cancel();
downstream.onError(e);
return;
}
synchronized (this) {
buffer = b;
consumerIndex++;
}
if (restartTimerOnMaxSize) {
timer = w.schedulePeriodically(this, timespan, timespan, unit);
}
}

This bug will lead to #793. I think setting restartTimerOnMaxSize to false will be a good choice. Or we can add a flag when task is running and do not dispose the timer task.

Specifications:

  • Client Version: 6.7.0
  • InfluxDB Version: 2.6.1
  • JDK Version: 11
  • Platform: linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant