-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 cancelled ephemeral models (#1993) #2024
Conversation
During ctrl+c handling, check the name of the canceled connection if it's the name of an ephemeral node, suppress the cancel message
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 qq here, but this looks very good to me otherwise!
@@ -242,6 +242,11 @@ def execute_nodes(self): | |||
raise | |||
|
|||
for conn_name in adapter.cancel_open_connections(): | |||
if self.manifest is not None: | |||
node = self.manifest.nodes.get(conn_name) | |||
if node is not None and node.is_ephemeral_model: |
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.
Are there any node types that won't have an is_ephemeral_model
attribute? Like tests/snapshots/run-operations, etc?
Edit: I don't think run-operations go through this code-path in practice, 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.
run-operations can't go through this path. Snapshots have is_ephemeral_model
, this code path can only happen for nodes (in particular manifest.nodes.get(conn_name)
can only return an Optional[CompileResultNode]
) mypy will actually complain if is_ephemeral_model
is missing from any type that can end up in node
, I'm pretty sure!
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.
amazing, ship it :)
Fix #1993
Suppress messages from cancelling models if the models are ephemeral. Temp connections and connections that aren't models/ephemeral models are still included in the output.