From a16b341d908b77380296644082ff99645fef5392 Mon Sep 17 00:00:00 2001 From: Jeroen Grusewski Date: Mon, 20 Jul 2026 21:30:01 +0000 Subject: [PATCH] =?UTF-8?q?fix(ib-gateway):=20zero-pad=20AUTO=5FRESTART=5F?= =?UTF-8?q?TIME=20(8:00->08:00=20AM)=20=E2=80=94=20stops=20~16=20restarts/?= =?UTF-8?q?day?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IBC's parser rejected '8:00 AM' ('Auto restart time setting must be hh:mm AM/PM'), leaving the daily auto-restart UNCONFIGURED, so the gateway churned ~35 restarts over 2 days instead of one clean daily cycle. Zero-padded to '08:00 AM' — IBC now logs 'Auto restart time set to 08:00 AM' (verified live 2026-07-20, fresh pod RESTARTS=0). 08:00 UTC is before the 09:00 UTC UCITS rebalance window so the daily restart won't collide with execution. Also bumped liveness failureThreshold 5->6 (180s) for the reauth window. Co-Authored-By: Claude Opus 4.8 --- infra/k8s/services/ib-gateway.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/infra/k8s/services/ib-gateway.yaml b/infra/k8s/services/ib-gateway.yaml index f45b133..96c64b1 100644 --- a/infra/k8s/services/ib-gateway.yaml +++ b/infra/k8s/services/ib-gateway.yaml @@ -76,8 +76,11 @@ spec: # full re-login each time). 08:00 UTC is clear of the 14:35 rebalancer + 23:30 nightly windows. - name: TIME_ZONE value: "Etc/UTC" + # MUST be zero-padded hh:mm (IBC's parser rejects "8:00 AM" with "Auto restart time setting must be + # hh:mm AM or hh:mm PM" — the rejection left the daily auto-restart UNCONFIGURED, so the gateway + # churned ~16 restarts/day instead of one clean daily cycle. Verified in the pod log 2026-07-20.) - name: AUTO_RESTART_TIME - value: "8:00 AM" + value: "08:00 AM" # Persist jts.ini + IBC config across pod restarts (a fresh empty volume just does a clean first-run # login) so settings survive a deploy/reschedule instead of being rebuilt each time. - name: TWS_SETTINGS_PATH @@ -105,7 +108,9 @@ spec: port: 4002 initialDelaySeconds: 120 periodSeconds: 30 - failureThreshold: 5 + # 6×30s = 180s tolerance: the daily auto-restart + IBKR reauth window drops port 4002 for up to a + # couple of minutes; too tight a threshold would k8s-kill the pod mid-reauth and compound the churn. + failureThreshold: 6 volumeMounts: - name: tws-settings mountPath: /home/ibgateway/tws_settings