mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-22 12:43:32 +09:00
fix(dashboard): name the proxy's real load status for a refused tail
The proxy caps rate and concurrent tails with 429, so the retry reasoning and its test now say so. Leaving Follow also remounts the log list, so the history it falls back to opens at the newest line even when the reader had scrolled up while following. Assisted-by: LLM Signed-off-by: ZverGuy <maximbel2003@gmail.com>
This commit is contained in:
1 parent
1b4ce7433e
commit
ebdd74ce4e
3 files changed
+4
-3
No files matched your search
+1
-1
@@ -129,7 +129,7 @@ export function LogsView({ scope }: { scope: ObservabilityScope }) {
|
||||
</p>
|
||||
)}
|
||||
{error ? <ProxyNotice what="Logs" error={error} /> : null}
|
||||
{!follow && history.isLoading ? <Spinner /> : <LogLines entries={entries} />}
|
||||
{!follow && history.isLoading ? <Spinner /> : <LogLines key={followRun ?? "history"} entries={entries} />}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
+1
-1
@@ -68,7 +68,7 @@ describe("useLogTail", () => {
|
||||
})
|
||||
|
||||
it("retries a tail refused for load instead of stopping", async () => {
|
||||
const { wrapper } = setup(new Response("too many concurrent requests", { status: 422 }), ndjson(line(T1, "a")))
|
||||
const { wrapper } = setup(new Response("too many concurrent requests", { status: 429 }), ndjson(line(T1, "a")))
|
||||
|
||||
const { result } = renderHook(() => useLogTail("/root/", "*", 1, { retryDelayMs: 1 }), { wrapper })
|
||||
|
||||
|
||||
+2
-1
@@ -14,7 +14,8 @@ interface TailSnapshot {
|
||||
|
||||
const FLUSH_MS = 100
|
||||
const MAX_RETRY_MS = 30_000
|
||||
// A 422 or 429 on tail is load (rate or concurrent-tail caps), which backoff outlasts.
|
||||
// Load refusals retry: the proxy caps rate and concurrent tails with 429 (422 in
|
||||
// its first builds), and a reconnect can race the previous tail's freed slot.
|
||||
const FATAL: ReadonlySet<string> = new Set(["bad-request", "unauthorized", "forbidden", "not-available"])
|
||||
|
||||
const sleep = (ms: number, signal: AbortSignal) =>
|
||||
|
||||
Reference in new issue
Block a user