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

treat IOException in index check as success #4402

Merged
merged 12 commits into from
Sep 25, 2023

Conversation

vladak
Copy link
Member

@vladak vladak commented Aug 23, 2023

As suggested in #4401 (reply in thread), the index check should treat IOException separately. If such error happens, the indexer exits with return code of 2. The exit code of 1 is restricted to legitimate index check errors. The Docker startup script will wipe out the index (with CHECK_INDEX set) only if indexer program returns 1.

This also changes how the checks are done by the indexer. Previously, the index checks were cumulative, such that when duplicate document check was specified, the indexer also performed version check. This is no longer true, the check modes are now exclusive.

Also, new check for definitions was added, however at this stage this is experimental as there are variances and nuances how definitions are generated for various files. The check takes the definitions as produced by ctags and loosely checks if they are present in the corresponding source file.

For the test of IOException being throw, I tried using static method mocking (had to update to Mockito v5 first), however had no luck with that, so the test is based on IOException being thrown for non-existent directory. Should probably bite the bullet and convert the IndexCheck class to non-static/utility so that normal mocking can be done.

@vladak vladak added the indexer label Aug 23, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Aug 23, 2023
@vladak vladak merged commit 7f716df into oracle:master Sep 25, 2023
@vladak vladak deleted the index_check_careful_with_exceptions branch September 25, 2023 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
indexer OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant