You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -830,17 +829,30 @@ This ensures requests have sufficient time to queue during traffic spikes while
830
829
831
830
#### Timeout Alignment
832
831
833
-
<Callouttype="warn">
834
-
Timeouts must be aligned! If your plugin takes up to 120s, set the pool request timeout accordingly.
835
-
</Callout>
832
+
Plugin execution timeouts are derived from each plugin's `timeout` in `config.json` (default 300s). The only fixed internal timeout is for admin operations (`precompile`, `cache`, `invalidate`), which use 30s because they are expected to be fast.
836
833
837
-
```bash
838
-
# In config.json: "timeout": 120
834
+
For request handling, ensure the HTTP request timeout is large enough:
839
835
840
-
# Environment should match:
841
-
export PLUGIN_POOL_REQUEST_TIMEOUT_SECS=120
836
+
```json
837
+
// 1. Plugin execution timeout (in config.json)
838
+
{
839
+
"plugins": [{
840
+
"id": "my-plugin",
841
+
"timeout": 120
842
+
}]
843
+
}
842
844
```
843
845
846
+
```bash
847
+
# 2. HTTP request timeout (must be strictly greater than plugin timeout)
848
+
# The internal timeout hierarchy adds up to 4s of buffer, so allow at least 5s extra
849
+
export REQUEST_TIMEOUT_SECONDS=125
850
+
```
851
+
852
+
<Callouttype="warn">
853
+
`REQUEST_TIMEOUT_SECONDS` should be **at least 5 seconds greater** than your longest plugin `timeout` (e.g., plugin timeout of 120s → `REQUEST_TIMEOUT_SECONDS=125`). Internally, the system adds a 4s buffer across its timeout layers; if the HTTP timeout is shorter than plugin timeout + 5s, Actix may close the connection while cleanup is in progress, causing `write EPIPE` errors.
854
+
</Callout>
855
+
844
856
#### Health & Recovery
845
857
846
858
Controls automatic health monitoring and recovery.
|`write EPIPE` / `Uncaught exception: Error: write EPIPE`| HTTP timeout while plugin still running | Set `REQUEST_TIMEOUT_SECONDS` at least 5s greater than your longest plugin `timeout` in config.json |
886
897
|`Plugin execution queue is full`| More requests than queue can hold | Increase `PLUGIN_POOL_MAX_QUEUE_SIZE` and `PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS`|
887
898
|`Connection limit reached`| Too many concurrent plugin connections | Increase `PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS`|
888
899
|`Failed to connect to pool after N attempts`| Pool server overwhelmed | Increase `PLUGIN_POOL_CONNECT_RETRIES` and `PLUGIN_POOL_MAX_CONNECTIONS`|
|`ScriptTimeout(N)`| Plugin execution exceeded timeout | Increase `timeout` in plugin config (config.json) and ensure `REQUEST_TIMEOUT_SECONDS` is at least 5s greater |
890
901
|`All connection permits exhausted`| Connection pool at capacity | Increase `PLUGIN_POOL_MAX_CONNECTIONS`|
891
902
|`FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory`| Worker heap too small | Increase `PLUGIN_WORKER_HEAP_MB` or reduce `PLUGIN_POOL_CONCURRENT_TASKS`|
892
903
|`Pool server crashed and restarting`| Memory pressure or GC issues | Check logs for heap usage; reduce `PLUGIN_MAX_CONCURRENCY` or increase system RAM |
0 commit comments