toga-ai 1.0.953 → 1.0.954
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ project: Worker
|
|
|
6
6
|
client: shared
|
|
7
7
|
type: feature
|
|
8
8
|
status: active
|
|
9
|
-
updated: 2026-10-
|
|
9
|
+
updated: 2026-10-06
|
|
10
10
|
owners: ["jcardinal", "mhammontree", "bala", "rgirish"]
|
|
11
11
|
files:
|
|
12
12
|
- worker2/Worker/Monitor/Compass.php
|
|
@@ -509,6 +509,18 @@ against the live SFTP:
|
|
|
509
509
|
(`rawlist` returned php-type=array, `type=1` for files, and `mtime` as a unix epoch matching the
|
|
510
510
|
filename timestamp.)
|
|
511
511
|
|
|
512
|
+
Timeout facts (apply the [in-run retry](#suppress-a-one-off-transient-in-the-reporter-not-in-oneuptime-in-run-retry) with these):
|
|
513
|
+
|
|
514
|
+
- **TCP connect timeout = 3rd constructor arg** `new SFTP($host, $port, $timeout)`, default 10s.
|
|
515
|
+
`setTimeout()` does NOT change it.
|
|
516
|
+
- **`setTimeout()` is per-read**, applied separately to key exchange, auth reply, channel open, SFTP
|
|
517
|
+
init, and each readdir packet — one attempt can far exceed one timeout value.
|
|
518
|
+
- Bound retries by an **overall deadline from run start**; split remaining time across steps
|
|
519
|
+
(per-step = min(step cap, remaining / steps)); stop when that falls below a floor. Instance: Staples
|
|
520
|
+
(75s deadline, 15s cap, 4 steps, 5s floor).
|
|
521
|
+
- **Never retry a login refusal** — throw a distinct code; retries can lock the account.
|
|
522
|
+
- `disconnect()` in `finally`.
|
|
523
|
+
|
|
512
524
|
**Symptom when either is wrong:** reads guarded by `isset()`/`??` silently make the aged-file count
|
|
513
525
|
always **0**, so the monitor never alarms and reads as perfectly healthy. Test the count against a folder
|
|
514
526
|
you know has aged files.
|
|
@@ -6,8 +6,8 @@ project: Worker
|
|
|
6
6
|
client: staples
|
|
7
7
|
type: client-feature
|
|
8
8
|
status: active
|
|
9
|
-
updated: 2026-
|
|
10
|
-
owners: ["bala"]
|
|
9
|
+
updated: 2026-10-06
|
|
10
|
+
owners: ["bala", "jcardinal"]
|
|
11
11
|
files:
|
|
12
12
|
- worker2/Worker/Monitor/Staples.php
|
|
13
13
|
- worker2/Config/beta.ini
|
|
@@ -60,6 +60,16 @@ The Staples pipeline runs in the **1.0 `worker`** tier, not worker2; worker2 onl
|
|
|
60
60
|
- Alarm when **>= 6 aged files** (tunable — can drop to 1 for single-file sensitivity).
|
|
61
61
|
- **5-minute cron cadence** (`*/5 * * * *`), chosen to pair with the OneUptime heartbeat criteria (received-in-8-min + `alarm:OK` recovery; not-received-15-min offline; not-received-10-min degraded), matching the existing Compass monitor convention rather than the source crons' hourly rate. The fast cadence is for a **reliable heartbeat**, not because the folders change that fast — the folder cutoffs above are calibrated against the **hourly 1.0 crons**, per the shared doc's "calibrate against the tier that runs the business logic" rule.
|
|
62
62
|
|
|
63
|
+
### In-run retry (transient connect failures)
|
|
64
|
+
|
|
65
|
+
Both actions retry the SFTP connect+list inside one run (shared [in-run retry](../../../2.0/apps/worker2/features/oneuptime-worker2-monitoring.md#suppress-a-one-off-transient-in-the-reporter-not-in-oneuptime-in-run-retry) + [phpseclib3 timeout facts](../../../2.0/apps/worker2/features/oneuptime-worker2-monitoring.md#sftp-monitoring-phpseclib3)). Added after a one-off `sftp_read_failed` / `fsockopen(): ... Connection timed out` took the inbound monitor offline (2026-10-06).
|
|
66
|
+
|
|
67
|
+
- `MAX_CONNECT_ATTEMPTS=3`, `RETRY_DELAY_SECONDS=5`, hard `SFTP_DEADLINE_SECONDS=75` from run start.
|
|
68
|
+
- Per-step timeout = min(`SFTP_STEP_TIMEOUT_SECONDS=15`, remaining / `SFTP_STEPS_PER_ATTEMPT=4`); stop retrying below `SFTP_MIN_STEP_TIMEOUT_SECONDS=5`.
|
|
69
|
+
- Login refusal throws `ERROR_CODE_LOGIN_FAILED` — not retried (no account lockout).
|
|
70
|
+
- `$sftp->disconnect()` in `finally`; error push includes `attempts`.
|
|
71
|
+
- Worst case ~75s SFTP + 10s push, under the 120s `maxExecutionTime`.
|
|
72
|
+
|
|
63
73
|
## Gotchas
|
|
64
74
|
|
|
65
75
|
- **phpseclib3 `rawlist` returns arrays, and its SFTP type constants are not loaded** — see the shared doc's [SFTP monitoring gotchas](../../../2.0/apps/worker2/features/oneuptime-worker2-monitoring.md#sftp-monitoring-phpseclib3). Getting this wrong silently makes the aged-file count always 0, so the monitor never alarms and looks healthy.
|
package/package.json
CHANGED