Skip to content

IRC thread fails silently on network issues. #45

@Julian-O

Description

@Julian-O

In Python, if a thread's run() method raises an unhandled exception, it is silently ignored, and the thread terminates - unless another thread joins it, or an excepthook is defined.

irc.py defines the IRC thread.

It doesn't handle any exceptions during connection. It doesn't handle any exceptions during authentication. The only exception it handles during normal communications is IOError, and its only response to that is to silently terminate the thread.

Further, this thread object is created in Chat, which offers no method for joining the thread. (Admittedly, the thread is publicly shared, so someone could dig in to the internals of the class to find it.)

The upshot is that if there are any networking issues, the Chat object stops receiving messages, without notice.

In practice, I am finding about 1 in 6 times, when I launch a Chat object, it is failing silently, and I never receive any messages.

I don't have a quick answer here - I imagine it involves joins and/or on_error() callbacks - but this is making the library unusable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions