Skip to content

Watcher dies with uncatchable ConnectionClosed error #147

@johnsca

Description

@johnsca

Originally reported via conjure-up's Sentry:

ConnectionClosed: WebSocket connection is closed: code = 1006, no reason.
  File "juju/model.py", line 648, in _start_watch
    self.loop)
  File "juju/utils.py", line 94, in run_with_interrupt
    result = [f.result() for f in done if f is not event_task]
  File "juju/utils.py", line 94, in <listcomp>
    result = [f.result() for f in done if f is not event_task]
  File "juju/client/facade.py", line 392, in wrapper
    reply = await f(*args, **kwargs)
  File "juju/client/_client1.py", line 59, in Next
    reply = await self.rpc(msg)
  File "juju/client/overrides.py", line 104, in rpc
    result = await self.connection.rpc(msg, encoder=TypeEncoder)
  File "juju/client/connection.py", line 238, in rpc
    result = await self.recv(msg['request-id'])
  File "juju/client/connection.py", line 175, in recv
    return await self.messages.get(request_id)
  File "juju/utils.py", line 63, in get
    raise value
  File "juju/client/connection.py", line 183, in receiver
    loop=self.loop)
  File "juju/utils.py", line 94, in run_with_interrupt
    result = [f.result() for f in done if f is not event_task]
  File "juju/utils.py", line 94, in <listcomp>
    result = [f.result() for f in done if f is not event_task]
  File "websockets/protocol.py", line 299, in recv
    raise ConnectionClosed(self.close_code, self.close_reason)

This should be reported to the Monitor. However, we probably also need to have block_until surface closed connections instead of blocking indefinitely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions