He-Pin opened a new pull request, #3172: URL: https://github.com/apache/pekko/pull/3172
### Motivation Source.unfoldResource can close the same resource twice when close(resource) fails. closeStage left the stage marked as open until after close returned, so postStop retried close after the failure. ### Modification Mark the resource as no longer open before invoking close(resource) in closeStage. Add regression coverage for close failures during normal completion and downstream cancellation. ### Result UnfoldResourceSource now propagates the close failure without attempting to close the same resource again from postStop. ### Tests - `rtk sbt "stream-tests / Test / testOnly org.apache.pekko.stream.scaladsl.UnfoldResourceSourceSpec"` / passed - `rtk scalafmt --mode diff-ref=origin/main` / passed with JDK Unsafe deprecation warnings - `rtk scalafmt --list --mode diff-ref=origin/main` / passed with JDK Unsafe deprecation warnings - `rtk git diff --check` / passed - `rtk sbt headerCreateAll` / passed - `rtk sbt "+headerCheckAll"` / passed - `rtk sbt checkCodeStyle` / passed - `rtk qodercli --help` and qodercli stdout review with `/tmp/project-review.diff` / No must-fix findings - `rtk sbt validatePullRequest` / not completed locally: arm64 host cannot load `leveldbjni-all:1.8` native library. The extracted binary reports x86_64/i386 while this host needs arm64; command was stopped after that environment failure. ### References Fixes #3162 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
