Skip to content
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

Merged
merged 1 commit into from
Jan 6, 2020

Conversation

beckjake
Copy link
Contributor

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.

During ctrl+c handling, check the name of the canceled connection
if it's the name of an ephemeral node, suppress the cancel message
@cla-bot cla-bot bot added the cla:yes label Dec 23, 2019
@beckjake beckjake requested a review from drewbanin December 23, 2019 21:35
Copy link
Contributor

@drewbanin drewbanin left a 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:
Copy link
Contributor

@drewbanin drewbanin Jan 6, 2020

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?

Copy link
Contributor Author

@beckjake beckjake Jan 6, 2020

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!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing, ship it :)

@beckjake beckjake merged commit c36a463 into dev/barbara-gittings Jan 6, 2020
@beckjake beckjake deleted the fix/ephemeral-cancelled branch January 6, 2020 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants