Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Open
@OrezzerO

Description

@OrezzerO
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.