-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Change where a connection is deleted #19096
Conversation
.toList(); | ||
|
||
for (final UUID uuidToDelete : uuidsToDelete) { | ||
connectionsHandler.deleteConnection(uuidToDelete); | ||
} |
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.
You could instead call .forEach
instead of calling toList
and then iterating over that list.
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.
It is done on purpose in order to have the exception thrown by deleteConnection
be thrown by the method (deleteConnection starts throwing in this PR).
if (dontDeleteInTemporal < DONT_DELETE_IN_TEMPORAL_TAG_CURRENT_VERSION) { | ||
if (workflowState.isDeleted()) { |
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.
Can combine these two if statements into one one to avoid one layer of nesting.
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.
Done
airbyte-server/src/main/java/io/airbyte/server/handlers/ConnectionsHandler.java
Show resolved
Hide resolved
final int dontDeleteInTemporal = | ||
Workflow.getVersion(DONT_DELETE_IN_TEMPORAL_TAG, Workflow.DEFAULT_VERSION, DONT_DELETE_IN_TEMPORAL_TAG_CURRENT_VERSION); | ||
|
||
if (dontDeleteInTemporal < DONT_DELETE_IN_TEMPORAL_TAG_CURRENT_VERSION && workflowState.isDeleted()) { |
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.
This is not placed in the right place, if should be on like 195. I moved the PR back to a draft.
The build is actually successful, it just fail to report its status. |
…ate-delete-endpoint
client.newWorkflowStub(ConnectionManagerWorkflow.class, getConnectionManagerName(connectionId)); | ||
connectionManagerWorkflow.deleteConnection(); | ||
} catch (final Exception e) { | ||
log.warn("The workflow is not reachable when trying to cancel it"); |
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.
nit: can we log the exception?
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.
Opps, I forget that. Will update.
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.
Done
* Tmp * Move when the deletion is performed * Re-enable disable test * PR comments * Use cancel * rename * Fix test and version check position * Log exception
What
In ordert to fix a flaky test, we need to delete a connection as soon as the endpoint for the deletion is called.
This PR is moving the deletion from a temporal activity to the API call.
This is addressing #18266
Another PR is needed in order to remove the extra signal in case there is a version issue. Since this is a tail activity call, it can be done right after this PR is moved to cloud.