feat: stop workflow request client event
What does this merge request do and why?
This MR adds StopWorkflowRequest
ClientEvent to stop a running workflow. When the event is received in DWS, it schedules to cancel a asyncio task of workflow, then GitLabWorkflow
context manager (it's known as checkpointer) finalizes the workflow status to be stopped
.
In order to cancel the coroutinue task, this MR also adds a timeout in ExecutorGitLabHttpClient
because _execute_action_and_get_action_response
could cause a deadlock if the main event loop doesn't put or pop an item from outbox
or inbox
. In general, these operations should be done within 30 sec.
Related to https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/-/issues/1302+ and DWS workhorse proxy graceful termination (gitlab-org/gitlab!203460)
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Merge request checklist
-
Tests added for new functionality. If not, please raise an issue to follow up. -
Documentation added/updated, if needed. -
If this change requires executor implementation: verified that issues/MRs exist for both Go executor and Node executor or confirmed that changes are backward-compatible and don't break existing executor functionality.