-
Notifications
You must be signed in to change notification settings - Fork 40
Add close for storage, transaction in data loader core #2699
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures that the distributed storage and distributed transaction manager objects are properly closed after the import process completes. Key changes include:
- Adding the closeResources() method to handle resource closure.
- Wrapping listener notifications and resource closure in try-catch blocks with exception suppression.
- Improving exception handling to propagate any errors encountered during the process.
| /** {@inheritDoc} Forwards the event to all registered listeners. */ | ||
| @Override | ||
| public void onAllDataChunksCompleted() { | ||
| Throwable firstException = null; |
Copilot
AI
May 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catching Throwable may inadvertently capture critical errors (e.g., OutOfMemoryError). Consider catching Exception to handle only recoverable errors.
|
|
||
| /** Close resources properly once the process is completed */ | ||
| public void closeResources() { | ||
| try { |
Copilot
AI
May 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catching Throwable in the closeResources method might hide serious errors. Consider catching Exception instead to avoid masking unrecoverable issues.
komamitsu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
brfrn169
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@inv-jishnu Don't we need to update the unit tests?
|
@brfrn169 san, |
brfrn169
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
ypeckstadt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you.
Torch3333
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Co-authored-by: Peckstadt Yves <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]>
Description
This PR ensures that the distributed storage and distributed transaction manager objects are properly closed once the import process is completed.
These changes address the feedback provided in the following comments from PR #2618:
Discussion 1
Discussion 2
Related issues and/or PRs
NA
Changes made
Checklist
Additional notes (optional)
NA
Release notes
NA