Skip to content

[benchmark] Close directory stream when loading sink configurations - #10138

Open
taoran92 wants to merge 1 commit into
apache:masterfrom
taoran92:fix/benchmark-sink-directory-stream
Open

taoran92 wants to merge 1 commit into
apache:masterfrom
taoran92:fix/benchmark-sink-directory-stream

Conversation

@taoran92

Copy link
Copy Markdown
Member

Purpose

Closes #10137.

Sink.load takes an iterator from Files.list without closing the owning stream, leaving directory resources open after configuration loading. Wrap the stream and the existing iteration in try-with-resources so resources are released on normal completion and when file reading or YAML parsing fails.

Tests

  • mvn -o -pl paimon-benchmark/paimon-cluster-benchmark -Pflink1 -DskipTests compile passed, including Checkstyle and Spotless checks.
  • git diff --check passed.
  • No new automated tests were added for this resource-lifetime change.

Manage the Files.list stream with try-with-resources so directory
resources are released after iteration and when configuration loading
fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Benchmark sink configuration loading leaves directory streams open

1 participant