Skip to content

Log exceptions when indexing #1303#4441

Closed
fedejeanne wants to merge 1 commit intoeclipse-jdt:masterfrom
fedejeanne:log_exceptions_when_indexing_2
Closed

Log exceptions when indexing #1303#4441
fedejeanne wants to merge 1 commit intoeclipse-jdt:masterfrom
fedejeanne:log_exceptions_when_indexing_2

Conversation

@fedejeanne
Copy link
Copy Markdown
Contributor

Similar to #4388 (but this time for the indexing of JARs/JRTs), do not rely on the VERBOSE flag, let the exceptions come to the error log and to the UI instead for better debugging.

Notice that I logged some exceptions as warnings since the operation will be retried i.e. it's recoverable.

Contributes to #1303

@fedejeanne fedejeanne force-pushed the log_exceptions_when_indexing_2 branch from cf2fa08 to 3667708 Compare September 26, 2025 10:46
if (VERBOSE) {
trace("-> failed to recreate index for path: "+containerPathString, e); //$NON-NLS-1$
}
Util.log(Status.warning("Failed to recreate index for path: " + containerPathString)); //$NON-NLS-1$
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: if you check the call hierarchy of the method, you'll notice that this ends up returning false in these jobs:

image

Which means it is a recoverable error, ergo I just posted a warning.

@fedejeanne
Copy link
Copy Markdown
Contributor Author

Would it be possible to review and merge this one too, please?

@trancexpress since Andrey said he is going to be busy in the next few weeks, maybe you could take a peek? This PR is very similar to the one Andrey already merged: #4388 .

@trancexpress
Copy link
Copy Markdown
Contributor

@fedejeanne what is the user expected to do with the log entries?

Generally the indexer runs in parallel with user operations, its possible it runs into errors due to e.g. deleted files. What does the user do with the log in that case?

@fedejeanne
Copy link
Copy Markdown
Contributor Author

fedejeanne commented Mar 26, 2026

@trancexpress if errors occurs then:

  1. It is an indication that some process may be blocking a file -> That process might have to be terminated or at least the user might try and file a report saying that Eclipse keeps getting blocked by other processes and it affects the indexing
  2. The user will know that functionality might be affected e.g. classes might not be found, class hierarchies might be inconsistent, search results too, etc.

This would give the user a heads-up and more insight as to why some things might be wrong in the views (hierarchies, searches, etc).

The goal of the PR is to bring the errors to the surface without the need to activate the VERBOSE mode. These kind of errors shouldn't happen very often (so the user should not be flooded by them) but if they do, the user should know it, know what to expect and maybe even take action.

@fedejeanne
Copy link
Copy Markdown
Contributor Author

fedejeanne commented Apr 7, 2026

@trancexpress after some consideration, I decided to first try and see if these errors really don't happen that often and if they are actionable. As you pointed out, there is not much to do when an error occurs since the indexes should try to rebuild themselves anyway and the user would only be annoyed if these are only informational messages.

I rolled out the tracing preference internally by adding these 2 lines in the .options file next to eclipse.exe.

org.eclipse.jdt.core/debug=true
org.eclipse.jdt.core/debug/indexmanager=true

Our centralized logs should start picking up these messages.

This solves the issue for me at the moment so there is no need to change the code.

Thank you for your hint, @trancexpress !

@fedejeanne fedejeanne closed this Apr 7, 2026
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.

2 participants