SwissDataScienceCenter / renkulab-docker

Source of docker images used for interactive sessions on Renkulab
https://renkulab.io
Apache License 2.0
14 stars 14 forks source link

Opening a shell prompt in a python session hangs #357

Open olevski opened 1 year ago

olevski commented 1 year ago

Details:

Opening a terminal does not give a prompt immediately. It just hangs for a long time. Pressing ctrl-c during this time gives this error:

File "/opt/conda/bin/powerline-shell", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.9/site-packages/powerline_shell/__init__.py", line 240, in main
    segment.add_to_powerline()
  File "/opt/conda/lib/python3.9/site-packages/powerline_shell/segments/git.py", line 71, in add_to_powerline
    self.join()
  File "/opt/conda/lib/python3.9/threading.py", line 1060, in join
    self._wait_for_tstate_lock()
  File "/opt/conda/lib/python3.9/threading.py", line 1080, in _wait_for_tstate_lock
    if lock.acquire(block, timeout):

Therefore it is most likely powerline-shell causing this.

The powerline-shell version in this session was 0.7.0.

olevski commented 1 year ago

Also considering that the latest version of this is from a while ago: image

We should simply consider switching to something else. Ideally something that is compiled and/or much more simple to install and not a python package.

olevski commented 1 year ago

From Rok:

For me, starting a local session hangs the terminal with this project: https://renkulab.io/projects/rok.roskar/adore

I do renku session start, then first I got a message about "dubious repository ownership" and after fixing that I do docker exec -ti bash and the shell hangs. Going into the container with sh I can run top and see

891 jovyan 20 0 721448 13516 7340 S 5.3 0.1 1:20.70 git-lfs 1057 jovyan 20 0 721704 13924 7596 S 5.3 0.1 1:10.31 git-lfs 1134 jovyan 20 0 721448 14928 8440 S 5.0 0.1 1:08.39 git-lfs 889 jovyan 20 0 7660 4148 3760 S 0.7 0.0 0:10.88 git 1055 jovyan 20 0 7660 4148 3760 S 0.7 0.0 0:10.11 git (edit: I tried it with the new image from this PR)

olevski commented 7 months ago

We did switch to powerline-go. But it seems that the opening of the shell still hangs.

I just wanted to post a few issues here from the powerline-go repo for reference:

The most promising suggestion is to set a limit on the maximum size of the git index. If it is larger than some value it is not checked by powerline shell. This index will grow if you have a lot of large uncommitted files.

Another option that may be worth checking is setting git config --global core.preloadIndex false someone reports in the older issue (no 61) that their startup time improved significantly with this option.