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
Disposing the server causes "rejected promise not handled within 1 second: Error [ERR_STREAM_WRITE_AFTER_END]" #723
Disposing the LSP client seems to trigger this error. I see it in the Dart server when we restart the server (eg. if you change something that requires changing the command line arguments), but I can also reproduce it in an integration test using the source repo/test server here.
'use strict';import*aschild_processfrom"child_process";import*aspathfrom'path';import*aslsclientfrom'vscode-languageclient/node';suite('Client integration',()=>{constserverModule=path.join(__dirname,'./servers/testServer.js');constdocumentSelector: lsclient.DocumentSelector=[{scheme: 'lsptests',language: 'bat'}];constmiddleware={};constclientOptions: lsclient.LanguageClientOptions={
documentSelector,synchronize: {},initializationOptions: {},
middleware
};test.only('Can dispose and re-create language server',async()=>{while(true){constprocess=child_process.spawn(`node`,[serverModule,'--stdio']);process.stderr.on("data",(data)=>console.error(data.toString()));process.on("exit",()=>console.log(`LSP Server quit!`));console.log(`Creating server`);constclient=newlsclient.LanguageClient('test svr','Test Language Server',()=>Promise.resolve({reader: process.stdout,writer: process.stdin}),clientOptions,);console.log(`Starting server`);constdisp=client.start();console.log(`Waiting for server to be ready`);awaitclient.onReady();console.log(`Waiting a little while before disposing...`);awaitnewPromise((resolve)=>setTimeout(resolve,1000));console.log(`Disposing server`);disp.dispose();awaitnewPromise((resolve)=>setTimeout(resolve,1000));console.log(`...`);}}).timeout(99999);});
I'm not certain, but it seems like it might be when it tries to send {"jsonrpc":"2.0","method":"exit"}.
I believe this is a duplicate of #726, which has been fixed for the 3.16.1 milestone. At least for me, the behaviour described (exit not sent) went hand in hand with the error reported here.
Activity
DanTup commentedon Jan 7, 2021
Commenting out this call to
exitdoes stop the error occurring. Perhapsconnection.shutdownis closing the connection soexitcan't be written?rgrunber commentedon Aug 27, 2021
I believe this is a duplicate of #726, which has been fixed for the 3.16.1 milestone. At least for me, the behaviour described (exit not sent) went hand in hand with the error reported here.
dbaeumer commentedon Aug 30, 2021
Yes, this got addressed but in the upcoming 3.17 release.