-
Notifications
You must be signed in to change notification settings - Fork 80
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
WatchNames: return errors via WebSocket #141
Conversation
Align behavior with plain Watch, which also does the same. Fixes rancher/rancher#41809 Signed-off-by: Silvio Moioli <silvio@moioli.net>
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.
LGTM
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.
One comment on the safety of returning the error event without doing any processing of the object that it contains.
I also have an overall question on the solution: my first glance would say that the ideal solution would be to immediately return a resource.error
event when we are given an invalid resource version, rather than a resource.start
, then a resource.error
, then a resource.stop
. I think that the idea here is just to align this with standard watch rather than re-evaluate the API behavior, but wanted to ask just to be sure - would you mind elaborating on why you choose the start -> error -> stop flow here?
As you mentioned, here I am proposing to align behavior with the I think you are right in pointing out this particular flow could be optimized to be less chatty, but that would need to be done for |
@MbolotSuse following our discussions can you approve and merge this? Relatedly: user reported success with the patch in the meantime. |
@moio I've resolved the outstanding thread on the functionality (and I think that we can merge this PR without further changes there), however, I'm not sure that the tests are working. Would you mind giving that a look? |
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2365164
to
d138622
Compare
@MbolotSuse please review once again and, if all looks OK,merge this directly. Thanks in advance |
Partially related, about your question which was left pending:
I took a deeper look. To recap, Therefore when
At this point I think that approach makes sense - if Steve is at least able to extract a string or a code from the error then there is a chance the UI can do something about it, therefore forward (eg. the "resource too old" situation that kicked off this PR). For an error whose type is completely unknown, there is no way to tell if it makes sense to forward to the UI or not and even if it does, there is no way to extract a meaningful string or code that the UI could check and react on a priori. It will need intervention from a Steve programmer anyway to add code for a specific type when such a case is found, and the best way to serve that future programmer is to have a reliable log. What could be argued, IMO, is to raise the log level from debug to info or even error to increase the visibility of those cases, if they are important at all. ATM I do not have reasons to change that, but others might. Please help me double-check the reasoning above. If it makes sense, I will not open a follow-up PR. |
includes rancher/steve#141 Signed-off-by: Silvio Moioli <silvio@moioli.net>
Signed-off-by: Silvio Moioli <silvio@moioli.net>
Signed-off-by: Silvio Moioli <silvio@moioli.net>
Signed-off-by: Silvio Moioli <silvio@moioli.net>
Signed-off-by: Silvio Moioli <silvio@moioli.net>
Align behavior with plain
Watch
, which also does the same. UI code actually expects the same behavior in both cases.Fixes rancher/rancher#41809