diff --git a/.github/workflows/linux-build-run.yml b/.github/workflows/linux-build-run.yml index faf61d9f108..0ef45ca792e 100644 --- a/.github/workflows/linux-build-run.yml +++ b/.github/workflows/linux-build-run.yml @@ -238,10 +238,14 @@ jobs: # The suite's C build compiles ~7,000 translation units, several of them # large, with full debug info. On ubuntu-24.04-arm it exhausted memory and # the runner was shut down mid-build, twice at the same step; extra swap - # lets the peak spill instead of taking the machine down. - - name: Add swap (arm64) - if: matrix.arch == 'arm64' + # lets the peak spill instead of taking the machine down. x64 joined it once + # the suite grew (#6118, #6106): every x64 run since went silent in + # `cmake --build` and was shut down about an hour in, while arm64 passed -- + # the arm64 symptom exactly. `df` is here so a recurrence shows whether the + # disk, not memory, is what ran out. + - name: Add swap run: | + df -h / free -m sudo fallocate -l 12G /cn1-swapfile sudo chmod 600 /cn1-swapfile diff --git a/vm/backend/src/com/codename1/backend/HttpServer.java b/vm/backend/src/com/codename1/backend/HttpServer.java index 4de80ae5f51..8354a9d831f 100644 --- a/vm/backend/src/com/codename1/backend/HttpServer.java +++ b/vm/backend/src/com/codename1/backend/HttpServer.java @@ -9271,15 +9271,19 @@ private void writeHeadAndBody(Conn conn, int fd, long session, Response response } if (streamed) { + // A bodiless response's writer is closed before the head is written, so + // the close happens-before anything the client does after reading the + // status. Closing it after the write let the client run ahead of it. + if (noBody) { + response.discard(); + } try { writeTo(fd, session, conn.out, 0, conn.outLength); } catch (IOException | RuntimeException headFailed) { response.discard(); throw headFailed; } - if (noBody) { - response.discard(); - } else { + if (!noBody) { ResponseOutput output = new ResponseOutput(fd, session, chunked, null, 0); //NOPMD CloseResource - complete flushes on success; failure must abort and the connection owns the socket. response.bodyWriter.writeTo(output); output.complete();