The GitHub Actions job "Publish nightly snapshots and documentation" on 
pekko-http.git/main has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
418e760eebc3698aefa5d52bbff3cd6f87624bf0 / PJ Fanning 
<[email protected]>
DeflateDecompressor: fix inflater memory leak (#1137)

* fix: DeflateDecompressor inflater memory leak

Motivation:
DeflateDecompressor allocates an Inflater per stream but never explicitly
releases its native memory. Under GCs with relaxed off-heap reclamation
(e.g. ZGC), repeated request decompression can accumulate unreclaimed
native buffers and eventually OOM.

Modification:
- Add createInflater(noWrap) factory method to DeflateDecompressor to
  allow test injection of a custom Inflater
- Track the current inflater in a var within createLogic
- Add idempotent cleanupInflater() that calls inflater.end()
- Override postStop() to call cleanupInflater(), covering normal
  completion, failure, and cancellation
- Add focused tests in DeflateSpec verifying the inflater is released
  on successful decode, early cancellation, and truncation

Result:
The Inflater's native memory is reclaimed promptly when the stage
terminates, regardless of termination path.

Tests:
- Not run - sbt/builds skipped per user request to conserve credits

References:
Refs apache/pekko-http#1134

* Update DeflateSpec.scala

* close existing inflater

* fix: await inflater.end() before asserting in cancellation test

The Sink.ignore future completes when take(1) sends Complete downstream,
but the Cancel signal that triggers postStop() (and thus end()) is a
separate actor message dispatched afterwards. This means awaitResult can
return before end() has been called, yielding endCalls = 0.

Add a CountDownLatch to TrackingInflater that is counted down inside
end(), and call inflater.awaitEnd() after awaitResult() in the
cancellation test to eliminate the race.

---------

Co-authored-by: copilot-swe-agent[bot] 
<[email protected]>

Report URL: https://github.com/apache/pekko-http/actions/runs/28912699913

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to