-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix: Exit on communication failure #429
Conversation
if "io.deephaven.plugin.type.ObjectCommunicationException" in str(e): | ||
# can no longer send, don't need to raise exception but do need to exit | ||
sys.exit() |
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.
We shouldn't be exiting without at least logging why we're exiting here.
Also I don't like doing a str(e)
comparison, is there any more definitive way of checking the exception type?
Include a ticket with steps to reproduce the issue as well so it's clear which scenario is being fixed here. The description in the PR is somewhat vague in the steps.
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.
I have a much better fix now. This is happening after on_close
from the MessageStream
is called, so I'm now flagging it there. There is still a possibility of throwing if the message stream closes after that check though. Not sure how likely it is. I could add the ugly try catch back (and check against the is_closed
variable) too. As far as I can tell there is no better way to catch and check for the specific exception - the error message itself originates in Java and is just put into a generic RuntimeError
.
Now that I've refined this, should we be logging? I know we don't want to hide errors, but this is a case where the component should already be gone and not sending anything and a log would just pollute the console.
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.
Wait, we don't want to exit all of Python in this scenario? Just clean up this widget, no?
if self._is_closed: | ||
sys.exit() |
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.
Just to be clear - this is just a safeguard for a race condition if the connection closes while it's rendering, yeah? In which case add a comment to that effect. Do we need the sys.exit()
and does that just exit this thread or ?
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.
The sys.exit() closes this thread only. The sys.exit() (or at least something that closes this thread) is necessary because as of right now, the thrown exception is what shuts down this thread. If it isn't caught, the thread will keep trying to send updates. Really, sys.exit() just throws an error itself, but a silent one.
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.
Couple of questions, suggestion to release liveness_scope
To add some more context after digging deep into this, it's a bit broader than I originally noted. The reason these specific renders are still happening are because the We could add specific |
fixes #430
Often when rerunning component creation, an error containing "Stream is already completed, no further calls are allowed" comes up
This doesn't need to raise an exception to the user as this is just the previous component's message stream signaling it is closed, but it does need to exit so it doesn't keep trying to hit the message stream.