You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The broker currently sends gRPC status code OK to consumers if terminating running subscriptions on a clean shutdown (e.g. caused by SigInt).
Instead it should send the code UNAVAILABLE because the result of a shutdown of the broker will be its unavailability.
Reasoning:
OK isn't a proper status code for that situation. A status OK signals that the stream has regularly ended. It makes sense in case where something finite is streamed, like file contents or a movie. When the end is reached the provider sends the ok to signal that all data has been send.
In the databroker case, a stream of signal updates is as by its nature an endless stream. Therefore, there is no reason for the broker to terminate an existing subscription - except in error cases. Also, from a consumer's perspective a subscription should live as long as the consumer is not cancelling it.
A shutdown of the broker - regardless of being intentionally (clean shutdown) as well as caused by an unexpected failure - is from that perspective always an exceptional situation for all the involved components, i.e. consumers, providers, and the broker itself: They basically expect to "run forever". (Of course they need to be prepared for possible unavailability of other components, but this is always an exceptional situation.
Therefore, I would go for the status code UNAVAILABLE.
I wouldn't use ABORTED because
any error returned will abort the subscription - so this gives no extra meaning,
The broker currently sends gRPC status code
OK
to consumers if terminating running subscriptions on a clean shutdown (e.g. caused by SigInt).Instead it should send the code
UNAVAILABLE
because the result of a shutdown of the broker will be its unavailability.Reasoning:
OK
isn't a proper status code for that situation. A statusOK
signals that the stream has regularly ended. It makes sense in case where something finite is streamed, like file contents or a movie. When the end is reached the provider sends the ok to signal that all data has been send.In the databroker case, a stream of signal updates is as by its nature an endless stream. Therefore, there is no reason for the broker to terminate an existing subscription - except in error cases. Also, from a consumer's perspective a subscription should live as long as the consumer is not cancelling it.
A shutdown of the broker - regardless of being intentionally (clean shutdown) as well as caused by an unexpected failure - is from that perspective always an exceptional situation for all the involved components, i.e. consumers, providers, and the broker itself: They basically expect to "run forever". (Of course they need to be prepared for possible unavailability of other components, but this is always an exceptional situation.
Therefore, I would go for the status code
UNAVAILABLE
.I wouldn't use
ABORTED
becauseABORTED
as given by the gRPC documentation of status codes.The text was updated successfully, but these errors were encountered: