-
Notifications
You must be signed in to change notification settings - Fork 7
fix(inkless): properly shutdown all thread pools #475
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
base: jeqo/refactor-shared-state
Are you sure you want to change the base?
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 pull request fixes thread pool resource leaks in three Inkless storage components by ensuring proper shutdown of all ExecutorService instances during broker lifecycle operations.
Key Changes:
- Added missing shutdown call for
executorServiceCacheStorein FileCommitter, preventing leak of 8 threads per broker shutdown - Implemented Closeable interface for DeleteRecordsInterceptor with proper ExecutorService shutdown using 5-second timeout
- Improved FetchOffsetHandler shutdown from basic
shutdown()toshutdownExecutorServiceQuietly()with 5-second timeout
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| storage/inkless/src/main/java/io/aiven/inkless/produce/FileCommitter.java | Added missing executorServiceCacheStore.shutdown() call and documentation about thread pool lifecycle |
| storage/inkless/src/test/java/io/aiven/inkless/produce/FileCommitterTest.java | Added verification for executorServiceCacheStore shutdown |
| storage/inkless/src/main/java/io/aiven/inkless/delete/DeleteRecordsInterceptor.java | Implemented Closeable, changed Executor to ExecutorService, added InklessThreadFactory for thread naming, and proper shutdown with timeout |
| storage/inkless/src/test/java/io/aiven/inkless/delete/DeleteRecordsInterceptorTest.java | Added close() calls to all tests and new test verifying shutdown behavior |
| storage/inkless/src/main/java/io/aiven/inkless/consume/FetchOffsetHandler.java | Changed to shutdownExecutorServiceQuietly with timeout, refactored constructor for testability |
| storage/inkless/src/test/java/io/aiven/inkless/consume/FetchOffsetHandlerTest.java | Added test verifying proper executor shutdown with timeout |
| storage/inkless/src/main/java/io/aiven/inkless/produce/Writer.java | Added documentation about thread pool lifecycle management |
| storage/inkless/src/main/java/io/aiven/inkless/consume/Reader.java | Added documentation about thread pool lifecycle management |
| core/src/main/scala/kafka/server/ReplicaManager.scala | Added close() call for inklessDeleteRecordsInterceptor in shutdown sequence |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
storage/inkless/src/main/java/io/aiven/inkless/delete/DeleteRecordsInterceptor.java
Outdated
Show resolved
Hide resolved
Fix resource management issues in three Inkless storage components: 1. FileCommitter: Add missing shutdown of executorServiceCacheStore in close(). Previously 8 threads (default config) were leaking on every broker shutdown cycle. 2. DeleteRecordsInterceptor: Implement Closeable interface for proper cleanup. Changed from generic Executor to ExecutorService for proper shutdown control, added InklessThreadFactory for consistent thread naming, and uses ThreadUtils.shutdownExecutorServiceQuietly() with 5-second timeout. 3. FetchOffsetHandler: Improve executor shutdown with proper timeout handling. Changed from shutdown() to shutdownExecutorServiceQuietly() to ensure graceful termination with 5-second timeout, matching the pattern used in Reader component. All components now properly implement resource cleanup, preventing thread leaks during normal broker lifecycle operations.
2458994 to
89571b9
Compare
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
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix resource management issues in three Inkless storage components:
FileCommitter: Add missing shutdown of executorServiceCacheStore in close(). Previously 8 threads (default config) were leaking on every broker shutdown cycle.
DeleteRecordsInterceptor: Implement Closeable interface for proper cleanup. Changed from generic Executor to ExecutorService for proper shutdown control, added InklessThreadFactory for consistent thread naming, and uses ThreadUtils.shutdownExecutorServiceQuietly() with 5-second timeout.
FetchOffsetHandler: Improve executor shutdown with proper timeout handling. Changed from shutdown() to shutdownExecutorServiceQuietly() to ensure graceful termination with 5-second timeout, matching the pattern used in Reader component.
All components now properly implement resource cleanup, preventing thread leaks during normal broker lifecycle operations.