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

superfluous stack trace produced when priting CacheException when annotation cache is disabled for a repository #4596

Closed
vladak opened this issue Jul 15, 2024 · 0 comments
Assignees
Labels

Comments

@vladak
Copy link
Member

vladak commented Jul 15, 2024

When running the indexer with elevated log level, the following exception can be printed in the log for a repository that has annotation cache disabled:

2024-07-15 11:57:56.780+0200 FINEST t16415 AnalyzerGuru.lambda$findBySuffix$5: '/foo/bar.c': chosen by suffix: CAnalyzerFactory
2024-07-15 11:57:56.780+0200 FINE t16415 DefaultIndexChangedListener.fileAdd: Add: '/foo/bar.c' (CAnalyzer)
2024-07-15 11:57:56.787+0200 FINER t16416 IndexDatabase.createAnnotationCache: failed to create annotation
org.opengrok.indexer.history.CacheException: repository {dir='/foo',type=Mercurial,historyCache=on,renamed=true,merge=true,annotationCache=off} does not allow to create annotation cache for '/foo/bar.c'
        at org.opengrok.indexer.history.HistoryGuru.createAnnotationCache(HistoryGuru.java:1174)
        at org.opengrok.indexer.index.IndexDatabase.createAnnotationCache(IndexDatabase.java:1307)
        at org.opengrok.indexer.index.IndexDatabase.addFile(IndexDatabase.java:1286)
        at org.opengrok.indexer.index.IndexDatabase.lambda$indexParallel$9(IndexDatabase.java:1920)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

The stack trace for the exception is superfluous in this case and can be omitted. The CacheException can be thrown from createAnnotationCache() also based on IOException where the stack trace could be useful so these two cases need to be distinguished.

@vladak vladak added the indexer label Jul 15, 2024
@vladak vladak self-assigned this Jul 15, 2024
vladak added a commit to vladak/OpenGrok that referenced this issue Jul 15, 2024
@vladak vladak closed this as completed in 6aa0332 Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant