Skip to content

do not log stack trace for CacheException reporting disabled cache an… #4597

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

Merged
merged 6 commits into from
Jul 17, 2024

Conversation

vladak
Copy link
Member

@vladak vladak commented Jul 15, 2024

This change removes superfluous stack trace from the log entry in the case of disabled annotation cache by adding a property to CacheException and performing the logging based on this property.

The alternative would be to change the code in HistoryGuru#createAnnotationCache() and avoid throwing the exception in such case however that would impact testability. Or, try to use a hack and set the elements of the exception object via setStackTrace() which seems fragile (if it actually works in this case).

Example of the changed log entry:

15:06:23 FINER: failed to create annotation: repository {dir='/var/opengrok/src.linux/linux',type=git,historyCache=on,renamed=false,merge=true,annotationCache=off} does not allow to create annotation cache for '/var/opengrok/src.linux/linux/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.yaml'
15:06:23 FINEST: Added: '/linux/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.yaml' (YamlAnalyzer) (took 8 ms)

While there, I fixed some related and not so related nits.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 15, 2024
@vladak vladak added indexer and removed OCA Verified All contributors have signed the Oracle Contributor Agreement. labels Jul 15, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 15, 2024
@vladak vladak marked this pull request as draft July 15, 2024 12:11
otherwise it would print nothing
@vladak vladak marked this pull request as ready for review July 15, 2024 13:07
@vladak vladak requested a review from ginoaugustine July 16, 2024 08:51
@vladak vladak merged commit 53a4fda into oracle:master Jul 17, 2024
9 checks passed
@vladak vladak deleted the cache_exception_vs_repo branch July 17, 2024 09:08
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.

2 participants