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

JS-100 Allow the server to restart after failed status #4995

Merged
merged 2 commits into from
Dec 5, 2024
Merged

Conversation

zglicz
Copy link
Contributor

@zglicz zglicz commented Dec 4, 2024

JS-100

Tested by hand with killing the node processes and waiting a minute to see that the server actually gets respawned. See logs:

 [2024-12-04T16:52:13.064] [sonarlint-analysis-engine] DEBUG sonarlint - Skipping the start of the bridge server as it failed to start during the first analysis or it's not answering anymore
..
 [2024-12-04T16:52:23.924] [sonarlint-analysis-engine] DEBUG sonarlint - Skipping the start of the bridge server as it failed to start during the first analysis or it's not answering anymore
..
 [2024-12-04T16:52:30.923] [sonarlint-analysis-engine] DEBUG sonarlint - Skipping the start of the bridge server as it failed to start during the first analysis or it's not answering anymore
..
 [2024-12-04T16:52:36.868] [sonarlint-analysis-engine] DEBUG sonarlint - Skipping the start of the bridge server as it failed to start during the first analysis or it's not answering anymore
..
 [2024-12-04T16:52:43.438] [sonarlint-analysis-engine] WARN sonarlint - No workDir in SonarLint
 [2024-12-04T16:52:43.439] [sonarlint-analysis-engine] DEBUG sonarlint - Setting deploy location to /Users/michal.zgliczynski/codes/SonarJS
 [2024-12-04T16:52:43.439] [sonarlint-analysis-engine] INFO sonarlint - 'sonar.nodejs.executable' is set. Skipping embedded Node.js runtime deployment.
 [2024-12-04T16:52:43.439] [sonarlint-analysis-engine] DEBUG sonarlint - Starting server
 [2024-12-04T16:52:43.439] [sonarlint-analysis-engine] DEBUG sonarlint - Creating Node.js process to start the bridge server on port 65465 
 [2024-12-04T16:52:43.439] [sonarlint-analysis-engine] INFO sonarlint - Running in SonarLint context, metrics will not be computed.
 [2024-12-04T16:52:43.439] [sonarlint-analysis-engine] INFO sonarlint - Using Node.js executable /Users/michal.zgliczynski/.nvm/versions/node/v22.9.0/bin/node from property sonar.nodejs.executable.
 [2024-12-04T16:52:43.439] [sonarlint-analysis-engine] DEBUG sonarlint - Checking Node.js version
 [2024-12-04T16:52:43.439] [sonarlint-analysis-engine] DEBUG sonarlint - Launching command /Users/michal.zgliczynski/.nvm/versions/node/v22.9.0/bin/node -v
 [2024-12-04T16:52:43.462] [sonarlint-analysis-engine] DEBUG sonarlint - Using Node.js v22.9.0.
 [2024-12-04T16:52:43.462] [sonarlint-analysis-engine] DEBUG sonarlint - Launching command /Users/michal.zgliczynski/.nvm/versions/node/v22.9.0/bin/node /Users/michal.zgliczynski/codes/SonarJS/package/bin/server.cjs 65465 127.0.0.1 /Users/michal.zgliczynski/codes/SonarJS true true false 
 [2024-12-04T16:52:44.125] [nodejs-stream-consumer] INFO sonarlint - Memory configuration: OS (36864 MB), Node.js (4144 MB).
 [2024-12-04T16:52:44.125] [nodejs-stream-consumer] DEBUG sonarlint - Starting the bridge server
 [2024-12-04T16:52:44.13] [nodejs-stream-consumer] DEBUG sonarlint - The bridge server is listening on port 65465
 [2024-12-04T16:52:44.134] [nodejs-stream-consumer] DEBUG sonarlint - The worker thread is running
 [2024-12-04T16:52:44.244] [sonarlint-analysis-engine] DEBUG sonarlint - Bridge server started on port 65465 in 805 ms
 

@zglicz zglicz requested a review from vdiez December 4, 2024 16:01
@vdiez
Copy link
Contributor

vdiez commented Dec 4, 2024

I wonder if we should limit the restart to cases when the process ended due to lack of heartbeats. For that we would need to check output the node process. Thoughts?

@zglicz zglicz merged commit 8b52d9f into master Dec 5, 2024
18 of 19 checks passed
@zglicz zglicz deleted the js-100 branch December 5, 2024 12:42
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