Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builder: Race conditions after #796 / strict mypy #856

Closed
tony opened this issue Dec 29, 2022 · 0 comments · Fixed by #857
Closed

Builder: Race conditions after #796 / strict mypy #856

tony opened this issue Dec 29, 2022 · 0 comments · Fixed by #857

Comments

@tony
Copy link
Member

tony commented Dec 29, 2022

strict mypy #796 makes certain uncovered loading scenarios error

  • tmuxp load when session already exists
  • Launching a new tmux server with default socket path and socket name
eduflow is already running. Attach? [Y/n] y
Traceback (most recent call last):
  File "/home/d/.cache/pypoetry/virtualenvs/tmuxp-m3jEKDEh-py3.11/bin/tmuxp", line 6, in <module>
    sys.exit(cli.cli())
             ^^^^^^^^^
  File "~/projects/python/tmuxp/src/tmuxp/cli/__init__.py", line 134, in cli
    command_load(
  File "~/projects/python/tmuxp/src/tmuxp/cli/load.py", line 640, in command_load
    load_workspace(
  File "~/projects/python/tmuxp/src/tmuxp/cli/load.py", line 416, in load_workspace
    _reattach(builder)
  File "~/projects/python/tmuxp/src/tmuxp/cli/load.py", line 161, in _reattach
    assert builder.session is not None
           ^^^^^^^^^^^^^^^
AttributeError: 'WorkspaceBuilder' object has no attribute 'session'

Declone to loading existing session

❯ tmuxp load ~/work/python/libvcs
[Loading] ~/projects/python/libvcs/.tmuxp.yaml
Already inside TMUX, switch to session? yes/no
Or (a)ppend windows in the current active session?
[y/n/a] - (y, n, a): n
Traceback (most recent call last):
  File "/home/d/.cache/pypoetry/virtualenvs/tmuxp-m3jEKDEh-py3.11/bin/tmuxp", line 6, in <module>
    sys.exit(cli.cli())
             ^^^^^^^^^
  File "~/projects/python/tmuxp/src/tmuxp/cli/__init__.py", line 134, in cli
    command_load(
  File "~/projects/python/tmuxp/src/tmuxp/cli/load.py", line 640, in command_load
    load_workspace(
  File "~/projects/python/tmuxp/src/tmuxp/cli/load.py", line 450, in load_workspace
    _load_detached(builder)
  File "~/projects/python/tmuxp/src/tmuxp/cli/load.py", line 217, in _load_detached
    builder.build()
  File "~/projects/python/tmuxp/src/tmuxp/workspace/builder.py", line 293, in build
    for w, wconf in self.iter_create_windows(session, append):
  File "~/projects/python/tmuxp/src/tmuxp/workspace/builder.py", line 416, in iter_create_windows
    w.set_window_option(key, val)
  File "~/projects/python/libtmux/src/libtmux/window.py", line 346, in set_window_option
    self.refresh()
  File "~/projects/python/libtmux/src/libtmux/window.py", line 84, in refresh
    return super()._refresh(
           ^^^^^^^^^^^^^^^^^
  File "~/projects/python/libtmux/src/libtmux/neo.py", line 174, in _refresh
    obj = fetch_obj(
          ^^^^^^^^^^
  File "~/projects/python/libtmux/src/libtmux/neo.py", line 242, in fetch_obj
    assert obj is not None
AssertionError

Intermittently during tmuxp load

Done in 1.87s.
Traceback (most recent call last):
  File "~/.local/bin/tmuxp", line 8, in <module>
    sys.exit(cli.cli())
             ^^^^^^^^^
  File "~/projects/tmuxp/src/tmuxp/cli/__init__.py", line 134, in cli
    command_load(
  File "~/projects/tmuxp/src/tmuxp/cli/load.py", line 640, in command_load
    load_workspace(
  File "~/projects/tmuxp/src/tmuxp/cli/load.py", line 452, in load_workspace
    _load_attached(builder, detached)
  File "~/projects/tmuxp/src/tmuxp/cli/load.py", line 184, in _load_attached
    builder.build()
  File "~/projects/tmuxp/src/tmuxp/workspace/builder.py", line 289, in build
    for w, wconf in self.iter_create_windows(session, append):
  File "~/projects/tmuxp/src/tmuxp/workspace/builder.py", line 411, in iter_create_windows
    w.set_window_option(key, val)
  File "~/.local/lib/python3.11/site-packages/libtmux/window.py", line 346, in set_window_option
    self.refresh()
  File "~/.local/lib/python3.11/site-packages/libtmux/window.py", line 84, in refresh
    return super()._refresh(
           ^^^^^^^^^^^^^^^^^
  File "~/.local/lib/python3.11/site-packages/libtmux/neo.py", line 174, in _refresh
    obj = fetch_obj(
          ^^^^^^^^^^
  File "~/.local/lib/python3.11/site-packages/libtmux/neo.py", line 242, in fetch_obj
    assert obj is not None
AssertionError
@tony tony linked a pull request Dec 29, 2022 that will close this issue
tony added a commit to tmux-python/libtmux that referenced this issue Dec 30, 2022
@tony tony closed this as completed in 25ce991 Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant