Github user zsxwing commented on the pull request:
https://github.com/apache/spark/pull/8417#issuecomment-142009424
@tdas let me try to use the following table to explain the issue. Assume
`currentBuffer` is empty at the beginning, and there are 3 threads running in
the following execution order:
execution order | thread 1 (RecurringTimer.loop()) | thread 2
(BlockGenerator.stop()) | thread 3
----------- | ----------- | -------- | -------
1 | prevTime = nextTime | |
2 | nextTime += period | |
3 | logDebug("Callback for " + name + " called at time " + prevTime) | |
4 | | | BlockGenerator.addData("1")
5 | | | BlockGenerator.addData("2")
6 | | state = StoppedAddingData |
7 | | blockIntervalTimer.stop(interruptTimer = false) |
8 | while (!stopped) { | |
9 | exit RecurringTimer.loop |
After step 9, `currentBuffer` is `[1, 2]` but won't be consumed since
`RecurringTimer` has already exited.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]