Commit 4123b16
SAMZA-1568: Handle ZkInterruptedException in zkclient.close.
When zookeeper session failures occur in a stream processor, leaves the group(zkClient is closed) and joins the group again.
The last step in that shutdown sequence is zkClient.close(). In some scenarios, it throws the following exception,
org.I0Itec.zkclient.exception.ZkInterruptedException: java.lang.InterruptedException
at org.I0Itec.zkclient.ZkClient.close(ZkClient.java:1278)
at org.apache.samza.zk.ZkControllerImpl.stop(ZkControllerImpl.java:92)
at org.apache.samza.zk.ZkJobCoordinator.stop(ZkJobCoordinator.java:141)
In existing implementation this is not handled, there by killing the stream processor. The following codepath triggers this exception:
`StreamProcessor.stop -> ZkJobCoordinator.stop() -> zkController.stop() -> zkUtils.close`
This exception causes the integration test to fail occasionally and can cause LocalApplicationRunner.waitForFinish method call to block indefinitely(since this callback event success, updates the latch state required for waitForFinish to end).
Author: Shanthoosh Venkataraman <[email protected]>
Reviewers: Jagadish <[email protected]>
Closes apache#416 from shanthoosh/zk_utils_close1 parent 002e131 commit 4123b16
File tree
3 files changed
+22
-6
lines changed- samza-core/src
- main/java/org/apache/samza/zk
- test/java/org/apache/samza/zk
3 files changed
+22
-6
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | 97 | | |
100 | 98 | | |
101 | 99 | | |
| |||
298 | 296 | | |
299 | 297 | | |
300 | 298 | | |
301 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
302 | 306 | | |
303 | 307 | | |
304 | 308 | | |
| |||
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | | - | |
92 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| |||
392 | 395 | | |
393 | 396 | | |
394 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
395 | 407 | | |
396 | 408 | | |
397 | 409 | | |
| |||
0 commit comments