apache / apache/maven-resolver

Volatile fields with inconsistent synchronization in IpcClient

Open
#1,991 0 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
152
Forks
160
Avg merge
1d 4h
Merged PRs (30d)
49

Description

**Affected version:** HEAD

**File:** `maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/IpcClient.java:78-87`

Fields `initialized`, `socket`, `output`, `input`, `receiver` are `volatile` but their compound use (read + method call) lacks synchronization. `send()` reads `output` into a local variable at line 316 without holding the monitor, then synchronizes on the local reference at line 323, but `close()` nulls `output` under `synchronized(this)` at line 361. `receive()` has the same pattern with `input`.

Originally reported in #1944.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/IpcClient.java, reviewing fields at lines 78-87 and the send(), receive(), and close() synchronization paths around lines 316, 323, and 361. Confirm that compound access to output and input is synchronized consistently with close(), with no unsynchronized read-and-method-call path remaining.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.