Skip to content

Commit 9efb423

Browse files
committed
respan jedi if it crashes
1 parent ec1f498 commit 9efb423

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/client/providers/jediProxy.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ function handleError(source: string, errorMessage: string) {
181181
logger.error(source + ' jediProxy', `Error (${source}) ${errorMessage}`);
182182
}
183183

184+
let spawnRetryAttempts = 0;;
184185
function spawnProcess(dir: string) {
185186
try {
186187
let environmentVariables = { 'PYTHONUNBUFFERED': '1' };
@@ -224,6 +225,11 @@ function spawnProcess(dir: string) {
224225
});
225226
proc.on("error", error => {
226227
handleError("error", error + '');
228+
spawnRetryAttempts++;
229+
if (spawnRetryAttempts < 10 && error && error.message &&
230+
error.message.indexOf('This socket has been ended by the other party') >= 0) {
231+
spawnProcess(dir);
232+
}
227233
});
228234
proc.stdout.setEncoding('utf8');
229235
proc.stdout.on("data", (data: string) => {

0 commit comments

Comments
 (0)