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

fix: Too many non-blocking read actions submitted at once in LSPDiagnosticHandler #1101

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

angelozerr
Copy link
Contributor

@angelozerr angelozerr commented Aug 10, 2023

LSPDiagnosticHandler](fix: Too many non-blocking read actions submitted at once in LSPDiagnosticHandler

Fixes #1089

@angelozerr
Copy link
Contributor Author

I created the PR but as I cannot reproduce it (hope @mfortunat could give us more info) , I cannot confirm that it fixes the issue.

I will try to emulate this usecase.

@angelozerr angelozerr force-pushed the diagnostic-non-blocking branch 6 times, most recently from 02be812 to 5bdba9b Compare August 11, 2023 08:28
@angelozerr angelozerr marked this pull request as ready for review August 11, 2023 08:28
@angelozerr
Copy link
Contributor Author

angelozerr commented Aug 11, 2023

The PR is ready.

To test, I retriggered the project index, and I type a lot of characters to handle diagnostics and I had no error.

I debug the IJ promise in the onError and I receive CANCELED exception which cancel the previous diagnostics.

I tried do do the same thing for all operations.

@sonarcloud
Copy link

sonarcloud bot commented Aug 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

private CancellablePromise<ResultOrError<R>> nonBlockingReadActionPromise;

public LSPCompletableFuture(Function<ProgressIndicator, R> code, String progressTitle, IndexAwareLanguageClient languageClient) {
public LSPCompletableFuture(Function<ProgressIndicator, R> code, String progressTitle, IndexAwareLanguageClient languageClient, Object coalesceBy) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why Object and not a CoalesceByKey?

Copy link
Contributor Author

@angelozerr angelozerr Aug 11, 2023

Choose a reason for hiding this comment

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

because perhaps some services don't need that and have an object which defines an unique hashcode

@fbricon
Copy link
Contributor

fbricon commented Aug 11, 2023

I hammered the LS during reindexation, they didn't skip a beat. Impressive work @angelozerr!

@fbricon fbricon merged commit 34b16af into redhat-developer:main Aug 11, 2023
11 checks passed
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.

Too many non-blocking read actions submitted at once in LSPDiagnosticHandler
2 participants