Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a user or system admin, I want improved validation of system settings #286

Open
epag opened this issue Aug 21, 2024 · 1 comment
Open

Comments

@epag
Copy link
Collaborator

epag commented Aug 21, 2024


Author Name: James (James)
Original Redmine Issue: 99120, https://vlab.noaa.gov/redmine/issues/99120
Original Date: 2021-12-01


Given system settings that are exposed to users and system/service administrators
When those settings are tweaked and invalid inputs are provided
Then the user should receive a useful message about what went wrong and how to fix it

@epag
Copy link
Collaborator Author

epag commented Aug 21, 2024


Original Redmine Comment
Author Name: James (James)
Original Date: 2021-12-01T17:12:04Z


Example to the contrary, set any of the thread counts to 0 and you will get something like:

java.lang.IllegalArgumentException: null
	at java.base/java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1293)
	at java.base/java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1215)
	at wres.pipeline.Evaluator.evaluate(Evaluator.java:232)
	at wres.pipeline.Evaluator.evaluate(Evaluator.java:183)
	at wres.MainFunctions.execute(MainFunctions.java:134)
	at wres.MainFunctions.call(MainFunctions.java:96)
	at wres.Main.main(Main.java:113)
	at wres.MainLocal.main(MainLocal.java:600)

It seems like validation mostly delegates to a commons helper, @StringUtils::isNumeric@, which is fine (it screens for integers), but not sufficient.

The expected behavior is to log a warning and fall back on (valid) defaults when invalid input is provided.

To be clear, we don't want an exception because the system can choose reasonable values, ultimately. A logged warning is fine.

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

No branches or pull requests

1 participant