You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@zeppelin.apache.org by "HwangRock (via GitHub)" <gi...@apache.org> on 2026/07/11 07:40:49 UTC
[PR] [ZEPPELIN-6481] Restore interrupt status after InterruptedException in JDBC completion loading [zeppelin]
HwangRock opened a new pull request, #5288:
URL: https://github.com/apache/zeppelin/pull/5288
### What is this PR for?
The `catch (InterruptedException e)` block around `awaitTermination(...)` in `createOrUpdateSqlCompleter(...)` in `JDBCInterpreter` logs a warning and closes the connection, but never restores the interrupt status. Catching `InterruptedException` clears the thread's interrupt flag, so the interrupt is swallowed: callers on the completion request path can no longer detect it, and cooperative cancellation and shutdown signals are silently dropped. This is the classic swallowed-interrupt anti-pattern.
This restores the interrupt with `Thread.currentThread().interrupt()` as the last statement of the block, after the connection-close attempt. Placing it last keeps the existing resource-release behavior running first, then leaves the interrupt status intact when the method returns so the calling thread can detect it.
### What type of PR is it?
Bug Fix
### Todos
* [x] Restore interrupt status in the `InterruptedException` catch block
* [x] Add a unit test covering the restored interrupt status
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-6481
### How should this be tested?
* `./mvnw test -pl jdbc -Dtest=JDBCInterpreterTest`
* New test `testCreateOrUpdateSqlCompleterRestoresInterruptStatusOnTimeout` pre-interrupts the calling thread so `awaitTermination(...)` throws `InterruptedException` immediately, drives the completer through the catch path, and asserts `Thread.currentThread().isInterrupted()` is `true` on return. Before the fix the flag is cleared and the assertion fails; after the fix it passes. 32 tests in the class pass.
### Screenshots (if appropriate)
N/A
### Questions:
* Does the license files need to update? No.
* Is there breaking changes for older versions? No.
* Does this needs documentation? No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ZEPPELIN-6481] Restore interrupt status after InterruptedException in JDBC completion loading [zeppelin]
Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul merged PR #5288:
URL: https://github.com/apache/zeppelin/pull/5288
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ZEPPELIN-6481] Restore interrupt status after InterruptedException in JDBC completion loading [zeppelin]
Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul commented on PR #5288:
URL: https://github.com/apache/zeppelin/pull/5288#issuecomment-4949904278
Merged into master (dfd8cf7d).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org