-
Notifications
You must be signed in to change notification settings - Fork 16
Notify stream-creator of stream stop #28
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: master
Are you sure you want to change the base?
Notify stream-creator of stream stop #28
Conversation
160121f to
5d87b88
Compare
1ebe042 to
e4e807d
Compare
e4e807d to
e99a7b6
Compare
| element_name, stream, stream_event, diagnostic, | ||
| in_destroy_stream=True)) | ||
| if stream.state == StreamState.ERROR: | ||
| break |
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.
This break prevents stop_stream being called on downstream elements if an upstream stop_stream raises
| break | ||
| destroy_stream_state = StreamState.ERROR | ||
| elif destroy_stream_state == StreamState.ERROR: | ||
| stream.state = StreamState.ERROR |
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.
Feed the error state back into the next stop_stream call, so that element knows the stream has stopped in error and can cleanup/finalise appropriately
| stream.lock.release() | ||
| self.destroy_stream(get_stream_id(), use_thread_local=False) | ||
| stream.state = StreamState.ERROR | ||
| self.destroy_stream(get_stream_id(), use_thread_local=False, diagnostic=diagnostic) |
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.
Passing diagnostic here allows the stop-stream message put on the response_queueindestroy_streamto include the diagnostic message fromstart_stream`
PipelineImpl posts to the listening response_queue and/or response_topic when the stream is destroyed. A stream creator might pass a queue_response or topic response when calling create_stream(), so it can be notified as frames are processed. If a stream exits due to an error in process_frame then these listeners will be notified, but if the stream exits without error then the listeners will not previously be notified.
e99a7b6 to
a64da07
Compare
A stream creator might pass a queue_response or topic response when calling create_stream(), so it can be notified as frames are processed.
If a stream exits in error, the stream creator will be notified, but if the stream exits without error, the stream creator has no way of knowing that the stream has ended.
This change posts to the queue and/or topic when the stream is destroyed with no error condition.
Implements #38