0

我在谷歌云上配置了一个带有托管证书的 kubernetes 入口。然后我将 theia/theia-full docker 映像作为一个 pod 和一个连接入口和 pod 的 kubernetes 服务。

我的浏览器中 theia 页面的初始加载工作正常,所有插件都在后端启动。之后,浏览器每 30 秒向 wss://mytheiadomain 发出另一个 websocket 请求。theia 后端日志

root ERROR [hosted-plugin: 59] Error: connection is closed
    at Object.create (/home/theia/node_modules/@theia/plugin-ext/lib/common/rpc-protocol.js:82:30)
    at Object.<anonymous> (/home/theia/node_modules/@theia/plugin-ext/lib/common/rpc-protocol.js:108:56)
    at Object.disposable.dispose (/home/theia/node_modules/@theia/core/lib/common/disposable.js:101:13)
    at DisposableCollection.dispose (/home/theia/node_modules/@theia/core/lib/common/disposable.js:78:40)
    at RPCProtocolImpl.dispose (/home/theia/node_modules/@theia/plugin-ext/lib/common/rpc-protocol.js:129:24)
    at /home/theia/node_modules/@theia/plugin-ext/lib/hosted/node/plugin-host.js:142:21
    at step (/home/theia/node_modules/@theia/plugin-ext/lib/hosted/node/plugin-host.js:48:23)
    at Object.next (/home/theia/node_modules/@theia/plugin-ext/lib/hosted/node/plugin-host.js:29:53)
    at fulfilled (/home/theia/node_modules/@theia/plugin-ext/lib/hosted/node/plugin-host.js:20:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  code: 'RPC_PROTOCOL_CLOSED'
}
root INFO [e894a0b2-e9cd-4f35-8167-89eb28e840d8][typefox.yang-vscode]: Disconnected.
root INFO [e894a0b2-e9cd-4f35-8167-89eb28e840d8][rebornix.ruby]: Disconnected.
root INFO [e894a0b2-e9cd-4f35-8167-89eb28e840d8][ms-python.python]: Disconnected.
...

并且所有插件断开连接并再次初始化。(有时我什至没有收到此错误消息,插件只是断开连接并初始化)

如果我切断浏览器的 wifi 连接,这不会发生!所以浏览器的 wss 请求似乎触发了重启。如果我在普通 docker 上本地运行 theia-full,则不会每 30 秒断开一次。

这是我在搜索了几个小时后追踪到的错误。任何提示将不胜感激。我可以提供更多的日志输出和我的配置文件。

4

1 回答 1

3

Google 负载均衡器的默认超时为30 秒。

对于外部 HTTP(S) 负载平衡器和内部 HTTP(S) 负载平衡器,如果 HTTP 连接升级到 WebSocket,后端服务超时定义了 WebSocket 可以打开的最长时间,无论是否空闲。

您需要使用所需的超时创建自定义BackendCondig 。

于 2020-10-20T20:42:57.477 回答