{"record":{"id":"8e42e2c77d1423aa","repo":"influxdata/influxdb","slug":"request-trigger-execution-cancelled","errorCode":null,"errorMessage":"request trigger execution cancelled","messagePattern":"request trigger execution cancelled","errorType":"http","errorClass":"PluginError","httpStatus":500,"severity":"warning","filePath":"influxdb3_processing_engine/src/worker/local.rs","lineNumber":474,"sourceCode":"                plugin_code_str.as_ref(),\n                schema,\n                query_endpoint,\n                write_endpoint,\n                logger,\n                &trigger_arguments,\n                query_params,\n                headers,\n                body,\n                py_cache,\n                plugin_root.as_deref(),\n                plugin_cancel,\n            )\n        });\n\n        let result = tokio::select! {\n            joined = plugin => joined?,\n            _ = cancel.cancelled() => {\n                return Err(anyhow!(\"request trigger execution cancelled\").into());\n            }\n        };\n\n        match result {\n            Ok((response_code, response_headers, response_body, plugin_return_state)) => {\n                self.handle_successful_run(plugin_return_state, &run_logger, \"request plugin\")\n                    .await;\n\n                Ok(TriggerResponse {\n                    status_code: response_code,\n                    headers: response_headers,\n                    body: response_body,\n                })\n            }\n            Err(error) => Err(PluginError::PluginExecutionError(error)),\n        }\n    }\n","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/influxdata/influxdb/blob/d28e26e048401c53cbb98cf2d6ab0cf1e98048ca/influxdb3_processing_engine/src/worker/local.rs#L456-L492","documentation":"Request-trigger plugin execution spawns the Python plugin and races it against a CancellationToken with tokio::select!. If cancellation wins — the HTTP client disconnected or the request was cancelled while the plugin ran — the worker returns Err('request trigger execution cancelled') and abandons the plugin task. This is an expected outcome of client-driven cancellation, not a plugin crash; any side effects the plugin already committed are kept.","triggerScenarios":"An HTTP request trigger whose plugin is still running when the caller goes away: curl killed, browser fetch aborted, reverse proxy/gateway timeout firing (504 then close), or server shutdown during in-flight request-trigger calls.","commonSituations":"Plugins doing slow work (outbound HTTP calls, big loops, sleeps) behind aggressive proxy timeouts; load balancer idle timeouts shorter than plugin runtime; clients with short SDK timeouts hitting a request trigger endpoint.","solutions":["Raise the client/proxy timeout above the plugin's worst-case runtime so the connection survives","Profile and shorten the plugin: avoid sleeps, bound loops, cache expensive setup in module scope","Treat the error as expected during shutdown/draining and don't alert on it","If partial plugin work is undesirable, make the plugin idempotent so a retry after cancellation is safe"],"exampleFix":"# before: proxy cuts the connection at 30s while the plugin runs\nlocation /api/v3/engine/request/ingest { proxy_read_timeout 30s; }\n\n# after: timeout sized to the plugin's worst case\nlocation /api/v3/engine/request/ingest { proxy_read_timeout 120s; }","handlingStrategy":"try-catch","validationCode":"# client side: set a timeout >= worst-case plugin runtime so the call isn't aborted\n# e.g. curl --max-time 120 \".../api/v3/engine/request/<plugin>\"","typeGuard":null,"tryCatchPattern":"match worker.run_request(/* ... */).await {\n    Err(e) if e.to_string().contains(\"request trigger execution cancelled\") => {\n        // client went away or shutdown: not a plugin bug — respond/drain quietly\n        Ok(StatusCode::from_u16(499)?)\n    }\n    other => other,\n}","preventionTips":["Size client, SDK, and reverse-proxy timeouts above the plugin's worst-case runtime","Keep request-trigger plugins fast: no sleeps, bounded loops, cached module-level setup","Make plugin side effects idempotent so retries after cancellation are safe","During server shutdown, expect these errors and don't page on them"],"tags":["influxdb","processing-engine","request-trigger","cancellation","tokio"],"backgroundTag":"request-cancelled","analyzedSha":"d28e26e048401c53cbb98cf2d6ab0cf1e98048ca","analyzedAt":"2026-08-16T19:53:34.623Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}