GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Provide modern TrackingFileManager by cstamas · Pull Request #1814 · apache/maven-resolver Conversation
|
| Category | Count | Key Items |
|---|---|---|
| Bug | 2 | Error message typo/wrong key; silent null/false on lock timeout |
| Design | 3 | Config key naming inconsistency; System.getProperties() safety; removed public constants |
| Minor | 3 | Javadoc typo; canonicalPath NPE risk; test-only coverage of in-JVM locks |
The most important issue is the inconsistent lock-timeout behavior in NamedLocksTrackingFileManager: update() correctly throws on timeout, but read() and delete() silently return null/false, which is indistinguishable from "file does not exist" per the TrackingFileManager contract.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| * @configurationType {@link java.lang.String} | ||
| * @configurationDefaultValue {@link #DEFAULT_LOCK_WAIT_TIME_UNIT} | ||
| */ | ||
| public static final String CONFIG_PROP_LOCK_WAIT_TIME_UNIT = CONFIG_PROPS_PREFIX + "timeUnit"; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nit: naming inconsistency. The existing (now deprecated) key uses dot-separated time.unit (aether.syncContext.named.time.unit), and the companion time key here also uses dots (aether.system.named.time). But this new key uses camelCase: aether.system.named.timeUnit.
Consider time.unit for consistency:
| public static final String CONFIG_PROP_LOCK_WAIT_TIME_UNIT = CONFIG_PROPS_PREFIX + "timeUnit"; | |
| public static final String CONFIG_PROP_LOCK_WAIT_TIME_UNIT = CONFIG_PROPS_PREFIX + "time.unit"; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I always hated my initial choice: aether.syncContext.named.time.unit and aether.syncContext.named.time. The .unit makes time look like an object (and not scalar) and unit be some property of it.... Also, these are totally new keys (prefix is different, is not aether.syncContext...).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| * @deprecated | ||
| */ | ||
| @Deprecated | ||
| public static final String CONFIG_PROP_TIME = CONFIG_PROPS_PREFIX + "time"; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Note: DEFAULT_TIME and DEFAULT_TIME_UNIT (previously at this location) were public static final constants. Removing them is a binary-incompatible change for any downstream code that referenced NamedLockFactoryAdapter.DEFAULT_TIME or NamedLockFactoryAdapter.DEFAULT_TIME_UNIT.
The config property strings (CONFIG_PROP_TIME, CONFIG_PROP_TIME_UNIT) are correctly deprecated rather than removed. Consider giving the same treatment to the default-value constants — deprecate and keep them, pointing to DefaultNamedLockFactorySelector.DEFAULT_LOCK_WAIT_TIME etc.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| public class NamedLocksTrackingFileManagerTest extends TrackingFileManagerTestSupport { | ||
| @Override | ||
| protected TrackingFileManager createTrackingFileManager(FS fs) { | ||
| return new NamedLocksTrackingFileManager(new LocalReadWriteLockNamedLockFactory(), 1L, TimeUnit.SECONDS); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This test uses LocalReadWriteLockNamedLockFactory (JVM-local ReentrantReadWriteLock). Since the production default is FileLockNamedLockFactory (file-lock), the inter-process locking path is untested. Consider adding a parallel test class (or parameterization) with FileLockNamedLockFactory for the DEFAULT filesystem case.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…dLockFactorySelector.java Co-authored-by: Guillaume Nodet <[email protected]>
…impl/NamedLocksTrackingFileManager.java Co-authored-by: Guillaume Nodet <[email protected]>
…impl/NamedLocksTrackingFileManager.java Co-authored-by: Guillaume Nodet <[email protected]>
…impl/named/DefaultNamedLockFactorySelector.java Co-authored-by: Guillaume Nodet <[email protected]>
…impl/TrackingFileManagerProvider.java Co-authored-by: Guillaume Nodet <[email protected]>
…impl/NamedLocksTrackingFileManager.java Co-authored-by: Guillaume Nodet <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Claude Code on behalf of Guillaume Nodet
All the issues from the previous review have been addressed:
read(), update(), and delete() now all consistently throw IllegalStateException on lock timeout. The Files.isReadable() pre-check was removed in favor of handling NoSuchFileException inside the lock — this is actually better than my original suggestion as it also eliminates the TOCTOU race.System.getProperties() safety: now uses stringPropertyNames() snapshot.DEFAULT_TIME / DEFAULT_TIME_UNIT: restored as @Deprecated, delegating to DefaultNamedLockFactorySelector — preserves binary compatibility.canonicalPath null guard: added.update() parent null guard: bonus defensive fix.LGTM.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@cstamas Please assign appropriate label to PR according to the type of change. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.