Skip to content

Close URL stream via try-with-resources in ExtensionUtil#312

Closed
NicoPiel wants to merge 9 commits into
OpenIntegrationEngine:mainfrom
NicoPiel:fix/extension-util-stream-leak
Closed

Close URL stream via try-with-resources in ExtensionUtil#312
NicoPiel wants to merge 9 commits into
OpenIntegrationEngine:mainfrom
NicoPiel:fix/extension-util-stream-leak

Conversation

@NicoPiel
Copy link
Copy Markdown
Collaborator

in.close() not in finally; exception during readLine() leaks the underlying HTTP connection; use try-with-resources to guarantee closure on all paths

NicoPiel and others added 9 commits May 25, 2026 23:03
$gc()/$g() JS APIs call lock() on keys never registered via putSync(), causing NPE; throw IllegalArgumentException with clear message instead

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
replaceValues() can return null; calling toString() unconditionally
throws NPE and halts channel message processing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
& and \ in env var values corrupt mirth.properties silently; add
escape_sed_replacement() helper and apply to all sed replacement
interpolations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
currentState is read across threads in isActive() and state checks
without synchronization; missing volatile allows stale cached reads,
letting channels continue processing after stop

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
commit() snapshots live stats map then inverts non-atomically; concurrent
update() calls between snapshot and inversion are silently lost; synchronize
snapshot+inversion on the statistics object

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
Integer.MAX_VALUE maximumPoolSize creates unlimited threads under JS load; cap at 100 to prevent OOM and OS thread exhaustion

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
export() ran network I/O and disk writes synchronously on EDT, freezing
entire Mirth client UI; move work to SwingWorker.doInBackground()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
CI built with Java 17 while Docker runtime uses Java 21; behavior
differences between versions are invisible in CI; align to Java 21.

Also drop java-package: 'jdk+fx' — no JavaFX dependencies exist in
the build files, and the zulu jdk+fx variant is not available for 21.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
in.close() not in finally; exception during readLine() leaks the underlying HTTP connection; use try-with-resources to guarantee closure on all paths

Signed-off-by: Nico Piel <nico.piel@hotmail.de>
@github-actions
Copy link
Copy Markdown

Test Results

 4 files   -   107   6 suites   - 208   9s ⏱️ - 5m 41s
18 tests  -   636  18 ✅  -   636  0 💤 ±0  0 ❌ ±0 
36 runs   - 1 272  36 ✅  - 1 272  0 💤 ±0  0 ❌ ±0 

Results for commit 78946bf. ± Comparison against base commit 5423492.

This pull request removes 636 tests.
com.mirth.commons.encryption.test.DigesterTest ‑ testArgon2d
com.mirth.commons.encryption.test.DigesterTest ‑ testArgon2i
com.mirth.commons.encryption.test.DigesterTest ‑ testArgon2id
com.mirth.commons.encryption.test.DigesterTest ‑ testFallback1
com.mirth.commons.encryption.test.DigesterTest ‑ testFallback2
com.mirth.commons.encryption.test.DigesterTest ‑ testFallback3
com.mirth.commons.encryption.test.DigesterTest ‑ testFallback4
com.mirth.commons.encryption.test.DigesterTest ‑ testPBKDF2
com.mirth.commons.encryption.test.DigesterTest ‑ testSHA256
com.mirth.commons.encryption.test.EncryptionTest ‑ testDigest
…

@NicoPiel NicoPiel closed this May 25, 2026
@NicoPiel NicoPiel deleted the fix/extension-util-stream-leak branch May 25, 2026 21:26
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.

1 participant