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

[Enhancement] Optimize OffsetStorageWriterImpl#beginFlush method handle logic #4795

Closed
2 of 3 tasks
mxsm opened this issue Mar 19, 2024 · 0 comments · Fixed by #4797
Closed
2 of 3 tasks

[Enhancement] Optimize OffsetStorageWriterImpl#beginFlush method handle logic #4795

mxsm opened this issue Mar 19, 2024 · 0 comments · Fixed by #4797
Labels
easy to fix enhancement New feature or request good first issue Issues for first-time contributors

Comments

@mxsm
Copy link
Member

mxsm commented Mar 19, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Enhancement Request

public synchronized boolean beginFlush() {
if (isFlushing()) {
throw new RuntimeException("OffsetStorageWriter is already flushing");
}
if (data.isEmpty()) {
return false;
}
this.toFlush = this.data;
this.data = new HashMap<>();
return true;
}

When flushing is in progress, a RuntimeException will be thrown if SourceWorker#commitOffsets method calls beginFlush. This error will propagate upwards causing the Source to exit.

Describe the solution you'd like

image
replace this exception with log print and return false.

I hope you understand how offsets are managed. It's not just a simple replacement.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@mxsm mxsm added enhancement New feature or request good first issue Issues for first-time contributors easy to fix labels Mar 19, 2024
@mxsm mxsm changed the title [Enhancement] Enhancement title [Enhancement] Optimize OffsetStorageWriterImpl#beginFlush method handle logic Mar 19, 2024
jevinjiang added a commit to jevinjiang/eventmesh that referenced this issue Mar 20, 2024
Pil0tXia pushed a commit that referenced this issue Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy to fix enhancement New feature or request good first issue Issues for first-time contributors
Projects
None yet
1 participant