Lachee / discord-rpc-csharp

C# custom implementation for Discord Rich Presence. Not deprecated and still available!
MIT License
579 stars 96 forks source link

RPC client's PID check can fail in containerised environments #109

Closed bdach closed 3 years ago

bdach commented 3 years ago

I'm reporting this issue as a collaborator on another project that uses discord-rpc-csharp, on behalf of another user. Most of the paper trail is in https://github.com/ppy/osu/issues/11103, but to summarise:

After a recent bump of this package the above report surfaced. In short, the reporting user was running our application bundled in a flatpak, which from what I understand is a linux-specific package distribution method that allows the applications packaged to be ran from inside a container environment (be it docker or otherwise).

As it turns out, docker containers don't respect the usual linux rules of not assigning pids below 300 (or even 10) to userland processes, therefore triggering the pid check recently added in https://github.com/Lachee/discord-rpc-csharp/commit/2e09291f9a6e74ee6375f1c4d65b1e1d99f5d0d3.

While we should be ensuring that this exception is not fatal on our side, I'm curious why this check had to be added, or why 10 is the cutoff PID value in the check, as I'm not sure I can see an explanation for either.

Lachee commented 3 years ago

Hello, Yes i actually ran into this issue myself on a Windows machine. Nowhere states that below 10 is reserved, however Discord had checks to ensure this was the case anyways. As a result, i was getting failures random because of the rule.

This issue has been brought up https://github.com/discord/gamesdk-and-dispatch/issues/103 and I had already patched this check by the time it was resolved.

I have forgotten to remove the exception on my end. I shall do that for you now.

bdach commented 3 years ago

Thanks a bunch for the prompt response! :+1: