Repository navigation
Fix UPnP IGD detection - #689
Merged
ReenigneArcher merged 2 commits intoJan 3, 2023
Merged
Conversation
7 of 18 tasks
Nonary
pushed a commit
to Nonary/vibeshine
that referenced
this pull request
Nov 12, 2026
…m#689) * fix(playnite): back off and rate-limit pipe reconnects When the pre-0.5 script connector (SunshinePlaynite.psm1) is still installed next to Playnite.DesktopApp.exe, Playnite loads it alongside the compiled plugin. Both serve the single-instance pipe Sunshine.PlayniteExtension, so the one that does not own the name gets ERROR_PIPE_BUSY from NamedPipeServerStream immediately. The accept loop retried with no delay and logged a WARN every ~1 ms to extensions.log and sunshine_playnite-*.log, growing them by gigabytes and keeping Defender's real-time scanner busy. Plugin: - Back off after a failed accept attempt: 250 ms doubling to 10 s with jitter, reset on a successful accept; the wait ends on Stop(). - Log the first failure of a run, then at most one summary per 60 s, and note recovery once a client is accepted. - Explain ERROR_PIPE_BUSY: another process owns the pipe, usually a second copy of the connector. - At startup, warn about any SunshinePlaynite.psm1 in Playnite's Extensions folders. Sunshine (IpcClient, also used by playnite-launcher): - Replace the fixed 500/300 ms reconnect sleeps with the same backoff; it resets only after a connection stays up for 5 s, so a connect-and-drop loop cannot spin either. Sleeps return promptly on stop(). - Rate-limit connect-failure logging the same way, with the Win32 error. - Add NamedPipeFactory::set_quiet_connect_failures() so per-attempt "pipe not found/busy" logs drop to debug for callers that report failures themselves, and last_connect_error() so the real error is reported instead of a GetLastError() clobbered by logging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(playnite): update pipe fixtures for the reconnect backoff The identification and virtual-display transport fixtures extract code from pipes.cpp and playnite_ipc.cpp, so they broke on the new connect_to_plugin signature and the factory's quiet-failure state. Carry that state into both fixtures and assert the connect error is reported on failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Vibeshine adaptation: preserve the existing ConnectorRetryPolicy server backoff and logging semantics, private IPC security contracts and their tests. Port native client backoff and legacy connector warning; extend the native fixture to check jitter bounds, exponential growth, cap and reset. (cherry picked from commit b739553a9653fa1b2a288f7e3ab2321ab1a0c3a4)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the UPnP status messages and allows the detection of UPnP iuds that are in status 2 (not connected)
An IGD in status 1 is the IGD of the network and connected (has an external IP which isn't in a private block)
An IGD in status 2 is also the IGD of the network but may not be connected due to various reasons (no external IP or external IP in a private IPv4/IPv6 block)
Sunshine should not discard an IGD of status 2 as the reason to the unconnected status is not determinable by an outside source and has to be fixed by the network administrator/owner. This can be a misconfigured second router or just the ISP being down due to various reasons.
We still do not attempt to open ports on a status 3 as this is just a UPnP device which is not an IGD.
Type of Change
.github/...)Checklist
Branch Updates
LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.