-
Notifications
You must be signed in to change notification settings - Fork 21
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
Extending BatchActuateStreamResponse #103
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,8 +178,10 @@ service VAL { | |
// e.g. if sending an unsupported enum value | ||
// - if the published value is out of the min/max range specified | ||
// | ||
// - Provider returns BatchActuateStreamResponse <- Databroker sends BatchActuateStreamRequest | ||
// No error definition, a BatchActuateStreamResponse is expected from provider. | ||
// - Databroker sends BatchActuateStreamRequest -> Provider shall return a BatchActuateStreamResponse, | ||
// for every signal requested to indicate if the request was accepted or not. | ||
// It is up to the provider to decide if the stream shall be closed, | ||
// as of today Databroker will not react on the received error message. | ||
// | ||
rpc OpenProviderStream(stream OpenProviderStreamRequest) returns (stream OpenProviderStreamResponse); | ||
|
||
|
@@ -284,7 +286,10 @@ message BatchActuateStreamRequest { | |
repeated ActuateRequest actuate_requests = 1; | ||
} | ||
|
||
// Message that shall be used by provider to indicate if an actuation request was accepted. | ||
message BatchActuateStreamResponse { | ||
SignalID signal_id = 1; | ||
Error error = 2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a bit of a architectural question, but do we really want a single Wouldn't it be better to have specific errors for different functions, i.e. an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the enum I used matched quite well. At least I can find use-cases for all of them
Off course one can argue that everything here is INVALID_ARGUMENT, so we do not need the rest. But to me the set seems quite reasonable. https://github.com/eclipse-kuksa/kuksa-databroker/blob/main/proto/kuksa/val/v2/types.proto#L64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that this could be further refined in the future I think to use ErrorCode if it meets current needs is sufficient for now. |
||
} | ||
|
||
message OpenProviderStreamRequest { | ||
|
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.
Maybe this is just a first step in implementing this. But shouldn't the error coming from the provider be forwarded to the originator of the
actuate(...)
call, i.e. the "consumer"?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.
Yes, I looked mostly at the Provider rpc.
But I assume we need quite a lot refactoring if we are to return results to the "consumer", some aspects I think of:
Actuate
/BatchActuate
are to return actual results, the Databroker will need to wait until the providers has replied (forBatchActuate
there could be multiple, right?)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.
What you are discussing here was postponed if I remember correctly as we were not sure if we wanted to put databroker to wait until it receives ACK of receipt and forwards it to the consumer.
So in my opinion, this PR is enough for now if databroker can output some debug actuate information.