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

Allow for deleting connection in an unexpected state #11302

Merged
merged 9 commits into from
Mar 28, 2022

Conversation

terencecho
Copy link
Contributor

@terencecho terencecho commented Mar 21, 2022

What

When a temporal workflow is in an unexpected state, there is no way to delete a connection unless you interact with temporal directly. This PR will make it so that the deletion occurs even if the temporal state is in an unexpected state and addresses issue #11214.

How

If the temporal workflow is in an unexpected state, we spin up a new workflow and send a signal to delete the connection.

Tests

In addition to unit tests, this was tested locally by terminating a temporal workflow with the command docker run --rm -it --entrypoint tctl --env TEMPORAL_CLI_ADDRESS=host.docker.internal:7233 temporalio/admin-tools:1.14.0 wf terminate --wid <workflow_id> and then attempting to delete the connection through the UI.

@github-actions github-actions bot added area/platform issues related to the platform area/worker Related to worker labels Mar 21, 2022
@terencecho terencecho temporarily deployed to more-secrets March 22, 2022 06:25 Inactive
@terencecho terencecho temporarily deployed to more-secrets March 22, 2022 06:26 Inactive
@terencecho terencecho temporarily deployed to more-secrets March 22, 2022 06:41 Inactive
@terencecho terencecho temporarily deployed to more-secrets March 22, 2022 06:41 Inactive
@terencecho terencecho temporarily deployed to more-secrets March 22, 2022 23:24 Inactive
@terencecho terencecho temporarily deployed to more-secrets March 22, 2022 23:24 Inactive
@terencecho terencecho temporarily deployed to more-secrets March 25, 2022 05:42 Inactive
@terencecho terencecho temporarily deployed to more-secrets March 25, 2022 05:42 Inactive
@terencecho terencecho marked this pull request as ready for review March 25, 2022 15:37
@terencecho
Copy link
Contributor Author

The unit test should probably all live in the temporal client test file, but for some reason the test kept on hanging when I tried to port the test to that file, so I kept them in the connection manager workflow test file for now. fyi @benmoriceau

@terencecho terencecho temporarily deployed to more-secrets March 25, 2022 15:39 Inactive
@terencecho terencecho temporarily deployed to more-secrets March 25, 2022 15:40 Inactive
Copy link
Contributor

@benmoriceau benmoriceau left a comment

Choose a reason for hiding this comment

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

It looks good overall.

I don't think that we need the tests that are in the ConnectionManagerWorkflowTest class. The fact that we are instantiating the Temporal client in it is a warning to me, we should just check that we call the start with signal or just the signal method base on the existence of the workflow in the temporal client.

Does it sound right to you?

@terencecho
Copy link
Contributor Author

@benmoriceau that works for me. That was my original plan, but i realize that test didn't actually track/check the state of anything. I was going to include both, but I ran into some null pointer exceptions with signalRequest.add(connectionManagerWorkflow::run, input); since connectionManagerWorkflow is mocked.

I think i can figure it out and put it up soon.

Copy link
Contributor

@benmoriceau benmoriceau left a comment

Choose a reason for hiding this comment

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

LGTM: Could we think about an AcceptanceTest for this as well?

@terencecho terencecho temporarily deployed to more-secrets March 25, 2022 23:10 Inactive
@terencecho terencecho temporarily deployed to more-secrets March 25, 2022 23:11 Inactive
@terencecho terencecho merged commit 577e99a into master Mar 28, 2022
@terencecho terencecho deleted the tcho/unexpected-state-delete-connection-11214 branch March 28, 2022 15:32
@terencecho
Copy link
Contributor Author

I just saw the comment about the AcceptanceTest after merging. I can work on one in a different diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform area/worker Related to worker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants