mynameborat opened a new pull request #1344: SAMZA-2510: Incorrect shutdown 
status due to race between runloop and process callback thread
URL: https://github.com/apache/samza/pull/1344
 
 
   **Symptom**: A race between the process callback thread and the runloop 
thread can result in incorrect shutdown status.
   **Issue**: Currently runloop performs message choosing and dispatching in a 
loop indefinitely until interrupted by an external shutdown request or an 
exception during processing. In async mode, message completion is notified by 
the process callback thread using `onComplete()` and `onFailure()` to represent 
corresponding success and failure. The failure callback updates the exception 
code within the runloop to notify processing failures. Similarly, shutdown can 
be requested by user code or end of stream messages through various scopes(task 
level, container level). These requests are notified to the runloop through 
shutdownNow flag.
   Currently as long as shutdownNow flag is not set, the exception code is 
promptly seen by the runloop and propagated upstream correctly. However, if a 
shutdown is requested, runloop doesn't check the exception code before exiting.
   **Changes**: Make sure we check the exception code before we exit. Also, set 
the exception code on process failure before updating the state to done to 
promptly signal runloop about failure.
   **Tests**: Added unit tests to check if the exception is thrown even if the 
shutdown is requested ahead of callback failure.
   **API Changes**: None
   **Usage Instructions**: None
   **Upgrade Instructions**: None

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to