-
Notifications
You must be signed in to change notification settings - Fork 915
Reapply "LSP: Speed up publish diagnostics on project scan." #8206
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
Conversation
|
what is the performance gain of this optimization? What does this solve? please verify that this doesn't cause the regression again #7981. there is a rudimentary smoke test #7981 (comment). What testing has been done so far? |
ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/errors/TaskCache.java
Show resolved
Hide resolved
ide/parsing.indexing/src/org/netbeans/modules/parsing/spi/indexing/ErrorsCache.java
Outdated
Show resolved
Hide resolved
ide/parsing.indexing/src/org/netbeans/modules/parsing/spi/indexing/ErrorsCache.java
Outdated
Show resolved
Hide resolved
ide/parsing.indexing/src/org/netbeans/modules/parsing/spi/indexing/ErrorsCache.java
Show resolved
Hide resolved
ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/errors/TaskCache.java
Show resolved
Hide resolved
More detailed information added to the PR description.
I have to admit that I have not run the whole brute force test which opens all NB projects. Instead I ran the short reproducer. No errors appeared in the log file. |
c57858a to
650d552
Compare
|
FWIW, I ran the script that opens all the NB modules. I didn't see nay exception that would seem to be related to this patch. There was one from javac's |
lahodaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks good to me. Some comments/proposals inline.
ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/errors/TaskCache.java
Show resolved
Hide resolved
ide/parsing.indexing/src/org/netbeans/modules/parsing/spi/indexing/ErrorsCache.java
Outdated
Show resolved
Hide resolved
ide/parsing.indexing/src/org/netbeans/modules/parsing/spi/indexing/ErrorsCache.java
Outdated
Show resolved
Hide resolved
ide/parsing.indexing/src/org/netbeans/modules/parsing/spi/indexing/ErrorsCache.java
Outdated
Show resolved
Hide resolved
ide/parsing.indexing/src/org/netbeans/modules/parsing/spi/indexing/ErrorsCache.java
Outdated
Show resolved
Hide resolved
ide/parsing.indexing/src/org/netbeans/modules/parsing/spi/indexing/ErrorsCache.java
Outdated
Show resolved
Hide resolved
|
not sure about the spec bump since it is bumped once per release already #8185 - but please squash before merge in any case |
This reverts commit 90aeca3.
74d5eaf to
60e4d89
Compare
|
Yes, please remove the spec bump (I already pointed out this had just been incremented). We handle increments per release already. |
@lahodaj what do you think? So far we have increased the versions with every change to the module's APIs which was consistent with records in |
|
Sorry for belated answer. Traditionally, and in the strict API dependency sense, when adding a new API entry point, one needs to increment the module's version, so that other modules can require the new version, so that they can reliably use the new API. It is true that inside NetBeans itself, we didn't put too much effort into keeping the use sites up-to-date (i.e. module A is using API from module B, but is not explicitly requiring the version of module B where the API was introduced). So, the case is not very strong. I am not sure what's the advantage of not incrementing the spec version? We presumably still want meaningful |
|
Spec version changes can be a cause of issue during delivery phases. Sigfiles too, although not here, for related reasons. The first step after delivery branch is increasing every spec version of every module. From a release API point of view, new additions are covered by that already. Of course we want meaningful |
|
Not sure I understand the problem. The master already has new specification versions, so unclear how changing the version on master would cause some new problems when merging from delivery? Overall, nothing will break catastrophically if we coalescence multiple API changes under one version. It is just slightly less precise. OTOH, I am still unclear what is the scarce resource we are trying to conserve here, by coalescing the API changes under the single version. I.e. what is the benefit of only updating the versions for release? |
|
Assuming linear progression, generally not an issue. Throw in a need to eg. revert a PR that includes a spec version change through both branches and it can cause some problems to iron out. Isolation is useful. The scarce resource is always time! 😄 The other time consuming thing is of course having to discuss it. We should have one approach here, whichever that is. |
|
i did mention module versioning on the 1-repo-2-schedules thread. Although at that point close to no details were known how the second schedule would actually look or how it would work so a lot of what I wrote are hypotheticals - the problem still applies. One spec version bump per major version is not gong to work anymore most likely since versioning is directly linked to releases. (although the version hash codes help to avoid the worst case scenario: one module with same version built twice containing different content) |
|
@mbien we've had basically one repo, two schedules, ever since VSNetBeans had interim releases. We had a discussion about whether we needed extra spec version increments at branching with @MartinBalin a while ago, and it was determined it was not needed by VSNetBeans. Having a spec version increment across all modules per branch point of either project is not really a problem either, although it is another reason for the necessity of coordinated branch points. Having them in the feature PRs can be, and has been, a problem. So if we don't need them, I'd prefer we didn't have them. If we do, we factor them in. Either way we could do with a consistent approach, and probably discussing on dev@ not here. For a concrete example of this causing extra work, and rather relevant to this PR! - #8007 |
yes I know that there already are extra releases - now there would be even more |
|
@mbien yes, but the primary point I'm making is that because of that we already had the discussion about whether extra spec increments were necessary to support VSNetBeans' schedule, and it was determined they were not. Unless that point actually needs revision, there's no impact there from having more releases. |
I'm somehow missing the problem. The referenced conflict was trivial and can locally by trivially fixed. The git fetch, merge, fix, push cycle ranges somewhere in the low minute range. Yes it is work, but the cumulated time taken to discuss this already dwarfs that. Bumping spec version on major updates, API changes and/or library updates is an establish practice and was even suggested to do as best practice for library updates. As @lahodaj this is not always strictly handled, but I think it is similar to what was done before Apache NetBeans. |
|
Sure, the merge conflict itself can be fixed quite quickly locally, as long as it's done in the way outlined, and never via GitHub's UI. It's a little ugly because we have to ensure I agree, the cumulated time taken here is starting to dwarf the problem, although experience tells me it's not quite as trivial as you make out. Personally, I'd just like to see consistency, rather than half taking one approach and half another. |
|
I am not clear what's the status here. I believe this change is not really problematic, besides the specification version change. While I see benefit in continuing to increase the spec version when doing API changes, I can live with updating the versions only once per release. So, I think we need a decision on whether to drop the spec version change, or continue with this patch as is. (While reverting API changes might be more tricky, reverting API changes is inevitably tricky. I would not see ease of revert of API changes as a significant argument for process design.) |
|
I would prefer having one spec version increment per API release, but not enough to put more time into the conversation on this PR. It's not a blocker. I just don't see the point in doing this as it's not applied consistently, causes minor headaches (not a problem, lots of things do), but primarily doesn't tell you anything useful.
Reverting anything prior to release is fairly simple. Reverting API after a release is generally a no-go. VSNetBeans interim releases are ignored there. The spec version in the previous PR of this told you nothing. That spec version now corresponds to a different API. An API that is tested for breakage via CI. Each spec version being a snapshot of released API makes sense to me. Anything else is in flux and cannot be relied upon, including currently by VSNetBeans. We have previously reverted features that have been released solely in VSNetBeans. The question of whether spec versions need to be relevant to VSNetBeans, as in API's are fixed at each VSNetBeans branch point, as @mbien alludes to above, then needs to be discussed ... but not on this PR. |
|
PR queue for delivery is empty atm and the release is coming closer so the risk that this is causing conflicts right now is very small. Reading the thread I think the consensus is to get this in as-is and I agree. I also agree that we have to discuss this somewhere how to proceed with version changes - otherwise this will repeat periodically under PRs. If one spec bump per NB release is still enough or not etc and what problems we are trying to solve with it. To me personally the logic is pretty simple: if there was a spec bump since last release already -> don't bump, simply refer to the specific version in the doc. Having bumps which never appear in maven central is just extra work and might be also confusing for the user who might be looking for artifacts which never existed. |
Attempt to reapply #7737 reverted by #7982 with additional fixes proposed in #7998.
The aim of this change is to speed up opening projects within the NetBeans Language Server and therefore improve its start up time.
So far, when opening the project, initial scan is performed (similar to regular NetBeans). During this scan all compilation errors (together with their source files and line numbers) are stored in the NB caches. After the scan completes, the Language Server iterates through all the source files with compilation errors (the list of them is obtained from caches) and compiles them again to produce diagnostic that are sent over Language Server Protocol to client - e.g. VSCode that displays them in the
Project Problemsview.With the changes in this PR, the Language Server (after the initial scan completes) produces the diagnostic directly from the information stored in caches without the necessity of the second compilation of the source files with compilations errors. To that purpose, the precise positions are added to the information about compilation errors stored in NB chaches during the initial scan. The LSP's Diagnostic requires the range at which the message applies to be specified (not only the line number stored in caches so far).