jeromeLB / client175

Automatically exported from code.google.com/p/client175
GNU General Public License v3.0
0 stars 0 forks source link

Reconnect fails after losing connection to MPD. #36

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Launch server.py
2. Open the client on the browser
3. Restart MPD (i.e. /etc/rc.d/mpd restart)

What is the expected output? What do you see instead?

Expected: the server reconnects succesfully and the UI is functional again. 
(and everything is a bed of roses :P)

The server detects the disconnection and tries to reconnect. But it fails and 
an exception is thrown.

After this point the UI is no longer usable.

Stack trace:
{{{
Connection lost while reading line
    reconnecting...
ERROR IN MPD_POLLER: [Errno 111] Connection refused
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 530, in __bootstrap_inner
    self.run()
  File "/opt/client175/mpd_proxy2.py", line 94, in run
    self._connect()
  File "/opt/client175/mpd_proxy2.py", line 80, in _connect
    self.con.connect(self._host, self._port, self._password)
  File "/opt/client175/mpd.py", line 419, in connect
    self._sock = self._connect_tcp(host, port)
  File "/opt/client175/mpd.py", line 407, in _connect_tcp
    raise socket.error(msg)
error: [Errno 111] Connection refused
}}}

Presumably the 1s sleep is not enough and there's only one attempt to reconnect.

Original issue reported on code.google.com by dnie...@gmail.com on 22 Jul 2011 at 10:09

GoogleCodeExporter commented 9 years ago

Original comment by cseic...@gmail.com on 30 Jul 2011 at 6:59