You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Receiving unexpected tsserver messages in server logs #291
I have noticed a lot of tsserver messages in the logs recently that indicate we are still connected to a tsserver instance after we should have shut it down. I'm not exactly sure why this is happening but I didn't use to see these.
Received a response for command 'open' and request_seq '0' but no resolver was found. This may be a bug in the code.
Response:
{
"seq": 0,
"type": "response",
"command": "open",
"request_seq": 0,
"success": true,
"performanceData": {
"updateGraphDurationMs": 379.10445799999997
}
}
Received a response for command 'open' and request_seq '1' but no resolver was found. This may be a bug in the code.
Response:
{
"seq": 0,
"type": "response",
"command": "open",
"request_seq": 1,
"success": true
}
Received a response for command 'open' and request_seq '2' but no resolver was found. This may be a bug in the code.
Response:
{
"seq": 0,
"type": "response",
"command": "open",
"request_seq": 2,
"success": true
}
@Sanjoy-droid I'm not sure the exact cause, but it happens very regularly for me. If you navigate between a srcbook, the home page, another srcbook, add/delete them, etc, I would expect you to come across this unless there's something unique going on in my environment.
@benjreinhart it's not your environment. I was able to reproduce it and the cult is "React's StrictMode". Once you disable it, the ts server will stop normally and you won't see those logs.
I am still not confident why it's happening. Maybe double invoking messes up with the lifecycle and hence the cleanup effect not running properly.
Anyways even with StrictMode enabled, we can just stop the ts server in a separate useEffect.
Activity
Sanjoy-droid commentedon Sep 20, 2024
hey @benjreinhart can you please elaborate how to reproduce this issue?
benjreinhart commentedon Sep 20, 2024
@Sanjoy-droid I'm not sure the exact cause, but it happens very regularly for me. If you navigate between a srcbook, the home page, another srcbook, add/delete them, etc, I would expect you to come across this unless there's something unique going on in my environment.
BeRecursive22 commentedon Sep 21, 2024
@benjreinhart it's not your environment. I was able to reproduce it and the cult is "React's StrictMode". Once you disable it, the ts server will stop normally and you won't see those logs.
I am still not confident why it's happening. Maybe double invoking messes up with the lifecycle and hence the cleanup effect not running properly.
Anyways even with StrictMode enabled, we can just stop the ts server in a separate useEffect.
@Sanjoy-droid let me know if this worked.
BeRecursive22 commentedon Sep 21, 2024
@benjreinhart or you can assign the issue to me for a deeper look.
BeRecursive22 commentedon Sep 21, 2024
@benjreinhart @nichochar
NOTE: Potential Resource Leak
I haven't dive deeper into the backend code but I hope we have a server-side timeout mechanism to stop inactive tsserver processes.
Sanjoy-droid commentedon Oct 22, 2024
@benjreinhart is PR #338 fixed this issue?