AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
220 stars 20 forks source link

"No connection established. Last error: null" after connection forcefully closed #305

Open ncsibra opened 1 week ago

ncsibra commented 1 week ago

Steps to reproduce:

  1. Start a GRPC server locally.
  2. Start a long-running server stream to that server.
  3. Shutdown the server while the connection is still active in VS Code.
  4. Restart server.
  5. Try to call any endpoint from VS Code, either unary or stream endpoint, it will return a "No connection established. Last error: null".

At point 3, VS Code shows a "Call cancelled" message, so looks like the connection was terminated on both sides, but for some reason after the server restart it won't be able to connect back. Sometimes it solves itself after a few tries, sometimes deleting the sessions looks like work, but a lot of times I need to restart VS Code to work again. It does not happen if there is no pending connection to the server, only when a stream is in progress and the server is forcefully stopped, which can happen a lot during development.

The relevant log entry:

Error: Error: 14 UNAVAILABLE: No connection established. Last error: null
    at AU.<anonymous> (/home/ncsibra/.vscode-server/extensions/anweber.vscode-httpyac-6.14.0/dist/extension.js:137:158735)
    at AU.emit (node:events:518:28)
    at Object.onReceiveStatus (/home/ncsibra/.vscode-server/extensions/anweber.vscode-httpyac-6.14.0/dist/extension.js:90:5903)
    at Object.onReceiveStatus (/home/ncsibra/.vscode-server/extensions/anweber.vscode-httpyac-6.14.0/dist/extension.js:88:8193)
    at /home/ncsibra/.vscode-server/extensions/anweber.vscode-httpyac-6.14.0/dist/extension.js:104:30902
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
ncsibra commented 1 week ago

It looks like it happens with simple unary streams if the last call before the server shutdown fails.