Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions apps/server/src/cloud/ManagedEndpointRuntime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,21 @@ describe("CloudManagedEndpointRuntime", () => {
expect(
ManagedEndpointRuntime.classifyRelayClientOutput("2026-06-17T02:00:00Z PNC runtime panic"),
).toBe("warning");
for (const prefix of ["", "Request failed "]) {
expect(
ManagedEndpointRuntime.classifyRelayClientOutput(
`2026-06-17T02:00:00Z ERR ${prefix}error="Incoming request ended abruptly: context canceled" connIndex=0`,
),
).toBe("debug");
}
for (const line of [
'2026-06-17T02:00:00Z ERR error="Incoming request ended abruptly: context deadline exceeded" connIndex=0',
'2026-06-17T02:00:00Z ERR Failed to serve tunnel connection error="context canceled"',
'2026-06-17T02:00:00Z FTL error="Incoming request ended abruptly: context canceled"',
'2026-06-17T02:00:00Z PNC error="Incoming request ended abruptly: context canceled"',
]) {
expect(ManagedEndpointRuntime.classifyRelayClientOutput(line)).toBe("warning");
}
});

it("classifies connection unregistration apart from registration and routine output", () => {
Expand Down
7 changes: 7 additions & 0 deletions apps/server/src/cloud/ManagedEndpointRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ export function classifyRelayClientOutput(
if (/\bRegistered tunnel connection\b/iu.test(line)) {
return "connected";
}
if (
/\bERR\s+(?:Request failed\s+)?error="Incoming request ended abruptly: context canceled"(?:\s|$)/u.test(
line,
)
) {
return "debug";
}
// cloudflared uses zerolog FTL/PNC for fatal/panic; classify them above debug too.
if (/\b(?:ERR|WRN|FTL|PNC)\b/u.test(line)) {
return "warning";
Expand Down
Loading