[GH-ISSUE #10] Crashes if connection to Discord is lost #1605

Closed
opened 2026-05-23 03:58:07 +01:00 by JakeStanger · 7 comments
Owner

Originally created by @JakeStanger on GitHub (Oct 15, 2020).
Original GitHub issue: https://github.com/JakeStanger/mpd-discord-rpc/issues/10

If Discord restarts or the connection to its RPC server drops for whatever reason, the program crashes.

thread '<unnamed>' panicked at 'Failed to send outgoing data: IoError(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })', /home/jake/.cargo/registry/src/github.com-1ecc6299db9ec823/discord-rpc-client-0.3.0/src/connection/manager.rs:131:30
Originally created by @JakeStanger on GitHub (Oct 15, 2020). Original GitHub issue: https://github.com/JakeStanger/mpd-discord-rpc/issues/10 If Discord restarts or the connection to its RPC server drops for whatever reason, the program crashes. ``` thread '<unnamed>' panicked at 'Failed to send outgoing data: IoError(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })', /home/jake/.cargo/registry/src/github.com-1ecc6299db9ec823/discord-rpc-client-0.3.0/src/connection/manager.rs:131:30 ```
JakeStanger 2026-05-23 03:58:07 +01:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@emersonrp commented on GitHub (Aug 15, 2023):

My Discord crashes every time I sleep/wake the computer, and occasionally for no good reason whatsoever, so I run into this a lot.

<!-- gh-comment-id:1679179212 --> @emersonrp commented on GitHub (Aug 15, 2023): My Discord crashes every time I sleep/wake the computer, and occasionally for no good reason whatsoever, so I run into this a lot.
Author
Owner

@JakeStanger commented on GitHub (Aug 16, 2023):

It looks like the underlying discord-presence crate doesn't surface the connection errors very well, so I'll open an issue there.

EDIT: Issue here: https://github.com/jewlexx/discord-presence/issues/62

<!-- gh-comment-id:1681322466 --> @JakeStanger commented on GitHub (Aug 16, 2023): It looks like the underlying `discord-presence` crate doesn't surface the connection errors very well, so I'll open an issue there. EDIT: Issue here: https://github.com/jewlexx/discord-presence/issues/62
Author
Owner

@JakeStanger commented on GitHub (Aug 21, 2023):

The above has been fixed and the library updated, so this is now resolved on master here.

I have noticed however that the connection retry logic in the library currently has no chill and really spams the socket/log, so I'm waiting for https://github.com/jewlexx/discord-presence/pull/73 to be merged before getting a release out or closing this.

<!-- gh-comment-id:1687084182 --> @JakeStanger commented on GitHub (Aug 21, 2023): The above has been fixed and the library updated, so this is now resolved on `master` here. I have noticed however that the connection retry logic in the library currently has no chill and really spams the socket/log, so I'm waiting for https://github.com/jewlexx/discord-presence/pull/73 to be merged before getting a release out or closing this.
Author
Owner

@emersonrp commented on GitHub (Aug 22, 2023):

I've managed to fix my Discord crashing on sleep/wake, which is itself a huge win, but yeah at boot time I think the systemd service starts before Discord so needs to be restarted every boot. All that to say that this is less of a worry than it used to be but still happens, and I'm super pleased to hear there are fixes in the works. Thanks!

<!-- gh-comment-id:1688623992 --> @emersonrp commented on GitHub (Aug 22, 2023): I've managed to fix my Discord crashing on sleep/wake, which is itself a huge win, but yeah at boot time I think the systemd service starts before Discord so needs to be restarted every boot. All that to say that this is less of a worry than it used to be but still happens, and I'm super pleased to hear there are fixes in the works. Thanks!
Author
Owner

@ashprice commented on GitHub (Sep 1, 2023):

I do not get crashes, and I can restart discord fine, but the mentioned logging issue is causing a rather high rate of I/O on an SSD with BTRFS.

My journalctl -b log file for the last 6 hours - of a mostly idle machine - is 1.1GB in size, 5,383,274 lines long, with 5,375,627 occurrences of the words 'discord' and 'rpc.' I looked into it because I happened to be investigating I/O for other reasons. I'm not quite sure this even with the write amplification of BTRFS this can explain an unaccounted for 12.6GB+ of writes, but I suppose I will test presently...

<!-- gh-comment-id:1702975337 --> @ashprice commented on GitHub (Sep 1, 2023): I do not get crashes, and I can restart discord fine, but the mentioned logging issue is causing a rather high rate of I/O on an SSD with BTRFS. My journalctl -b log file for the last 6 hours - of a mostly idle machine - is 1.1GB in size, 5,383,274 lines long, with 5,375,627 occurrences of the words 'discord' and 'rpc.' I looked into it because I happened to be investigating I/O for other reasons. I'm not quite sure this even with the write amplification of BTRFS this can explain an unaccounted for 12.6GB+ of writes, but I suppose I will test presently...
Author
Owner

@JakeStanger commented on GitHub (Sep 1, 2023):

It will retry and log as fast as your hardware can handle at the moment, so it will add up very quickly.

Supposedly everything is in place in the discord library, so I'm hoping to get time this weekend to have another look and get it sorted.

<!-- gh-comment-id:1703019108 --> @JakeStanger commented on GitHub (Sep 1, 2023): It will retry and log as fast as your hardware can handle at the moment, so it will add up very quickly. Supposedly everything is in place in the discord library, so I'm hoping to get time this weekend to have another look and get it sorted.
Author
Owner

@JakeStanger commented on GitHub (Sep 10, 2023):

This is now fully resolved in the latest master.

I'm waiting on discord-presence to get a release out before I do the same, as this relies on the package's master branch currently.

<!-- gh-comment-id:1712799334 --> @JakeStanger commented on GitHub (Sep 10, 2023): This is now fully resolved in the latest master. I'm waiting on `discord-presence` to get a release out before I do the same, as this relies on the package's master branch currently.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/mpd-discord-rpc#1605
No description provided.