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

auto_reconnect fails after a reload and restart #148

Closed
rvalieris opened this issue Feb 22, 2020 · 2 comments
Closed

auto_reconnect fails after a reload and restart #148

rvalieris opened this issue Feb 22, 2020 · 2 comments
Assignees
Labels

Comments

@rvalieris
Copy link

if you reload and restart i3, the auto_reconnect fails:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/site-packages/i3ipc/connection.py", line 518, in main
    raise loop_exception
  File "/usr/lib/python3.8/site-packages/i3ipc/connection.py", line 489, in main
    self._event_socket_setup()
  File "/usr/lib/python3.8/site-packages/i3ipc/connection.py", line 417, in _event_socket_setup
    self._subscribe(self.subscriptions)
  File "/usr/lib/python3.8/site-packages/i3ipc/connection.py", line 344, in _subscribe
    data = self._ipc_send(self._sub_socket, MessageType.SUBSCRIBE, json.dumps(events_obj))
  File "/usr/lib/python3.8/site-packages/i3ipc/connection.py", line 144, in _ipc_send
    data, msg_type = self._ipc_recv(sock)
  File "/usr/lib/python3.8/site-packages/i3ipc/connection.py", line 127, in _ipc_recv
    data = sock.recv(14)
ConnectionResetError: [Errno 104] Connection reset by peer

to reproduce:

  1. start a i3ipc program:
import i3ipc
i3 = i3ipc.Connection(auto_reconnect=True)
i3.on(i3ipc.Event.WINDOW, lambda _,e: print(e))
i3.main()
  1. reload i3
  2. restart i3

a restart by itself works, reload is fine too, but a restart (any time) after the reload causes the problem.

@acrisci
Copy link
Member

acrisci commented Mar 27, 2020

Yeah I can reproduce this.

@acrisci
Copy link
Member

acrisci commented Mar 27, 2020

It doesn't affect the asyncio connection.

@acrisci acrisci closed this as completed in 03bbbd0 Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants