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 race/error handling issues on NBLS restart. #8134

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

sdedic
Copy link
Member

@sdedic sdedic commented Jan 9, 2025

During testing, it turned out that when NBLS is enabled "fast enough" after extension start, the extension may not initialize properly.
There are surely more bugs ;)) but the ones most prominent are:

  • there was a missing catch() after stopClient() call
  • reject() on kill promise was called before kill actually completed
  • testAdapter was not re-initialized (and re-loaded with data) each time client restarts

In addition, if the client is stop()ped during/soon after restart, the Explorer (project view, database view or cloud assets) attemp to communicate with a dead client, which results in error notifications.

@sdedic sdedic added the VSCode Extension [ci] enable VSCode Extension tests label Jan 9, 2025
@sdedic sdedic added this to the NB25 milestone Jan 9, 2025
@sdedic sdedic requested review from dbalek and petrovic-d January 9, 2025 15:35
@sdedic sdedic self-assigned this Jan 9, 2025
@sdedic
Copy link
Member Author

sdedic commented Jan 10, 2025

During further testing it occurred that the request to restart NBLS because of change enableJava flag was fired before the logs were received and activationPending was re-set .... so the request to restart NBLS was ignored. It seems that the ancient "collision avoidance" is now fully obsolete by waiting on the client promise for stop().
I've removed the simple avoidance flag - but needed to slightly change code so that closed server will not respawn itself if another one is already starting.

Please review carefully.

@sdedic sdedic requested review from MartinBalin and lahodaj January 10, 2025 10:53
@sdedic sdedic force-pushed the lsp/ls-restart-fixes branch from 8d21c1a to 83f5757 Compare January 15, 2025 08:10
@sdedic
Copy link
Member Author

sdedic commented Jan 15, 2025

Squashed before merge

@sdedic sdedic merged commit dde79e3 into apache:master Jan 15, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VSCode Extension [ci] enable VSCode Extension tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants