Skip to content

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

Open
Lagejohn wants to merge 3 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 3 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

@Lagejohn Lagejohn commented May 22, 2026

Copy link
Copy Markdown
Collaborator

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
Comment thread mmtc-core/src/main/java/edu/jhuapl/sd/sig/mmtc/cfg/TimeCorrelationRunConfig.java Outdated
@sonarqubecloud

Copy link
Copy Markdown

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@rmseng

rmseng commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

LGTM

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

3 participants