Преглед изворни кода

docs: 2.13.1 - warn that connect() now blocks, so a count-bounded connect loop can outrun systemd

Found by smartbotic-vectorapi in its own units: 30 attempts at ~1 s each
became 30 x (timeoutMs + 1 s) = up to 180 s, past TimeoutStartSec=90, so a
service started while the database is down is killed instead of exiting
cleanly. Not an error shape but a latency change; the guide now says to
bound such a loop by a wall-clock deadline.
fszontagh пре 1 месец
родитељ
комит
3b9b0950b7
2 измењених фајлова са 10 додато и 1 уклоњено
  1. 0 0
      CLAUDE.md
  2. 10 1
      docs/integration-guide.md

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
CLAUDE.md


+ 10 - 1
docs/integration-guide.md

@@ -393,7 +393,16 @@ Rows already that large stay unreadable; the export names them `row_too_large`.
 **false** when the server cannot be reached. Before 2.13.1 it returned true
 without opening anything, even against a dead port. On false the client is
 still usable (gRPC keeps reconnecting; calls report `Unavailable` meanwhile).
-With the server down, `connect()` now takes up to `timeoutMs`. `isConnected()`
+With the server down, `connect()` now takes up to `timeoutMs`.
+
+**⚠ Check any loop that retries `connect()`.** A loop bounded by an attempt
+count - `for (i = 0; i < 30 && !db.connect(); ++i) sleep(1s);` - cost about 30 s
+before 2.13.1 and costs up to 30 x (timeoutMs + 1 s) = 180 s with the default
+5 s timeout. Under systemd that can outrun `TimeoutStartSec` (90 s is common),
+so a service started while the database is down - which a package postinst does
+on every upgrade - is killed mid-start instead of exiting cleanly. Bound such a
+loop by a wall-clock deadline, not an attempt count (found by
+smartbotic-vectorapi in its own units). `isConnected()`
 is the channel's last known state, not a live probe: use `healthCheck()` for
 "is the database answering now".
 

Неке датотеке нису приказане због велике количине промена