Skip to content

67 move config validation to before lock file is acquired#95

Open
Lagejohn wants to merge 2 commits into
mainfrom
67-mmtc-can-attempt-to-access-config-key-tablerunhistoryfilepath-before-the-config-is-validated-and-its-confirmed-that-the-key-exists
Open

67 move config validation to before lock file is acquired#95
Lagejohn wants to merge 2 commits into
mainfrom
67-mmtc-can-attempt-to-access-config-key-tablerunhistoryfilepath-before-the-config-is-validated-and-its-confirmed-that-the-key-exists

Conversation

@Lagejohn
Copy link
Copy Markdown
Collaborator

@Lagejohn Lagejohn commented May 22, 2026

E2E tests passed successfully.

Manually tested by leaving XML config key table.runHistoryFile.URI (old version of table.runHistoryFile.path) in place and testing before and after.

Previous behavior:

Exception in thread "main" java.lang.NullPointerException
	at java.base/java.util.Objects.requireNonNull(Objects.java:209)
	at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:263)
	at java.base/java.nio.file.Path.of(Path.java:147)
	at java.base/java.nio.file.Paths.get(Paths.java:69)
	at edu.jhuapl.sd.sig.mmtc.cfg.MmtcConfig.getRunHistoryFilePath(MmtcConfig.java:737)
	at edu.jhuapl.sd.sig.mmtc.cfg.MmtcConfig.getLockFileLocation(MmtcConfig.java:995)
	at edu.jhuapl.sd.sig.mmtc.cfg.MmtcConfig.acquireLockFile(MmtcConfig.java:1001)
	at edu.jhuapl.sd.sig.mmtc.app.MmtcCli.main(MmtcCli.java:113)

New behavior:

Exception in thread "main" edu.jhuapl.sd.sig.mmtc.app.MmtcException: MMTC correlation initialization failed.
	at edu.jhuapl.sd.sig.mmtc.app.MmtcCli.main(MmtcCli.java:111)
Caused by: edu.jhuapl.sd.sig.mmtc.app.MmtcException: Failed to validate TimeCorrelationConfigProperties.xml, missing 1 required key(s): [table.runHistoryFile.path]
	at edu.jhuapl.sd.sig.mmtc.cfg.MmtcConfig.validate(MmtcConfig.java:1423)
	at edu.jhuapl.sd.sig.mmtc.app.MmtcCli.main(MmtcCli.java:108)
MMTC correlation initialization failed.

…o-access-config-key-tablerunhistoryfilepath-before-the-config-is-validated-and-its-confirmed-that-the-key-exists
@sonarqubecloud
Copy link
Copy Markdown

@Lagejohn Lagejohn marked this pull request as ready for review May 28, 2026 19:12
@Lagejohn Lagejohn requested a review from rmseng May 28, 2026 19:12
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.

MMTC can attempt to access config key "table.runHistoryFile.path" before the config is validated and it's confirmed that the key exists

1 participant