eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.05k stars 2.5k forks source link

ide status often turned offline #6840

Open lxn179208 opened 4 years ago

lxn179208 commented 4 years ago

Description

I am using theia with k8s ingress controller, it shows the problem bellow: image image

Reproduction Steps

// the issue happens occasionally, so below steps may not work

0、build version and plugins "@theia/core" "^0.14.0"

{ "private": true, "dependencies": { "@theia/callhierarchy": "latest", "@theia/debug": "latest", "@theia/extension-manager": "latest", "@theia/file-search": "latest", "@theia/git": "latest", "@theia/json": "latest", "@theia/keymaps": "latest", "@theia/markers": "latest", "@theia/merge-conflicts": "latest", "@theia/messages": "latest", "@theia/mini-browser": "latest", "@theia/navigator": "latest", "@theia/outline-view": "latest", "@theia/plugin-ext": "latest", "@theia/plugin-ext-vscode": "latest", "@theia/preferences": "latest", "@theia/preview": "latest", "@theia/python": "latest", "@theia/search-in-workspace": "latest", "@theia/terminal": "latest", "@theia/textmate-grammars": "latest", "@theia/typescript": "latest", "@theia/variable-resolver": "latest", "agentx": "^1.10.7", "commandx": "^1.5.4", "debug": "^4.1.1", "typescript": "latest" }, "devDependencies": { "@theia/cli": "latest" }, "engines": { "install-alinode": "4" } } 1、open ide in chrome 2、open workspace and new terminal 3、in the terminal, I run the code below, the codes stored at mounted nas storage:

import torch
while True:
    N = 3
    A = torch.rand(N, N)
    torch.prod(A, 1, True)

4、just see the ide' status turning offline

OS and Theia version: linux build with master, build time 2020-01-07 Diagnostics: strace theia process logs: image

akosyakov commented 4 years ago

it is the issue with your infrastructure or network configuration, I cannot reproduce it locally or with Gitpod.

lxn179208 commented 4 years ago

it is the issue with your infrastructure or network configuration, I cannot reproduce it locally or with Gitpod.

I just add monitor cron cmd, curl http://127.0.0.1:3000 inside the pods, no response within 1 mins.

def get_ide_status():
    for _ in range(3):
        try:
            r = requests.get('http://127.0.0.1:3000', timeout=1)
            return (r.status_code == 200)
        except Exception as e:
            logging.error(e)
    return False
def main():
    while True:
        for _ in range(1000):
            if not get_ide_status():
                logging.info('No response from theia web. Restart Theia!')
            time.sleep(0.5)

the logs show:

ERROR:root:HTTPConnectionPool(host='127.0.0.1', port=3000): Read timed out. (read timeout=1) ERROR:root:HTTPConnectionPool(host='127.0.0.1', port=3000): Read timed out. (read timeout=1) ERROR:root:HTTPConnectionPool(host='127.0.0.1', port=3000): Read timed out. (read timeout=1) INFO:root:No response from theia web. Restart Theia! ERROR:root:HTTPConnectionPool(host='127.0.0.1', port=3000): Read timed out. (read timeout=1) ERROR:root:HTTPConnectionPool(host='127.0.0.1', port=3000): Read timed out. (read timeout=1) ERROR:root:HTTPConnectionPool(host='127.0.0.1', port=3000): Read timed out. (read timeout=1) INFO:root:No response from theia web. Restart Theia! ERROR:root:HTTPConnectionPool(host='127.0.0.1', port=3000): Read timed out. (read timeout=1) ERROR:root:HTTPConnectionPool(host='127.0.0.1', port=3000): Read timed out. (read timeout=1) ERROR:root:HTTPConnectionPool(host='127.0.0.1', port=3000): Read timed out. (read timeout=1) INFO:root:No response from theia web. Restart Theia! ERROR:root:HTTPConnectionPool(host='127.0.0.1', port=3000): Read timed out. (read timeout=1) ERROR:root:HTTPConnectionPool(host='127.0.0.1', port=3000): Read timed out. (read timeout=1) ERROR:root:HTTPConnectionPool(host='127.0.0.1', port=3000): Read timed out. (read timeout=1) INFO:root:No response from theia web. Restart Theia! root INFO [nsfw-watcher: 2965] Started watching: /root/.theia Started watching: /mnt/nas1/.theia/launch.json Started watching: /mnt/nas1/.theia/settings.json Started watching: /mnt/nas1/.theia/launch.json Started watching: /mnt/nas1/xianning.lu/test.py root INFO [452a5241-9b87-43b2-950e-7be2c441cf7d] Sync of 0 plugins took: 63.85000003501773 ms root INFO [452a5241-9b87-43b2-950e-7be2c441cf7d] Load contributions of 0 plugins took: 0.024999957531690598 ms root INFO [452a5241-9b87-43b2-950e-7be2c441cf7d] Start of 0 plugins took: 5711.094999918714 ms

lxn179208 commented 4 years ago

nodejs capture libuv info when theia is offline may be important:

image

lxn179208 commented 4 years ago

When I set process.env.UV_THREADPOOL_SIZE = 16;(default is 4), offline has not happened for a few days

habibali95 commented 4 years ago

Hello @lxn179208, did you find a solution to this issue?