Skip to content

Fix race/error handling issues on NBLS restart.#8134

Merged
sdedic merged 1 commit intoapache:masterfrom
sdedic:lsp/ls-restart-fixes
Jan 15, 2025
Merged

Fix race/error handling issues on NBLS restart.#8134
sdedic merged 1 commit intoapache:masterfrom
sdedic:lsp/ls-restart-fixes

Conversation

@sdedic
Copy link
Copy Markdown
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 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
Copy Markdown
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
Copy Markdown
Member Author

sdedic commented Jan 15, 2025

Squashed before merge

@sdedic sdedic merged commit dde79e3 into apache:master Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants