Repository navigation
Conversation
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.
When a connectivity probe encounters descriptor exhaustion, subsequent network callbacks can keep attempting probes without recording the failure: Android can wrap
EMFILEinUncheckedIOException, bypassing the existing handler.This change recognises
EMFILEandENFILEin checked and unchecked I/O exception chains and pauses optional probes across all networks for ten minutes. The cooldown survives service recreation within the process, is checked again inside queued work, and defers retries while the screen is off. A successful probe after the cooldown restores normal behaviour; ordinary connectivity failures retain their existing per-network backoff. Already-running probes are not cancelled. No timer or VPN/process restart is introduced; retries depend on subsequent network callbacks.Once per cooldown, after closing any returned probe socket, log a best-effort descriptor census: total count and aggregate types for at most 256 descriptors. Targets, filenames, destinations and descriptor identifiers are omitted. The snapshot is not atomic or representative of every descriptor type;
/proc/self/fdmay itself be unavailable under exhaustion, in which case that is reported without retrying. Socket counts are not active connection counts.This mitigates repeated optional work and improves diagnostics; it does not release the resources responsible for exhaustion or establish the cause. Other allocations can still fail. Issue #932 should remain open pending diagnosis.
Validation:
:app:testGithubDebugUnitTest --tests eu.faircode.netguard.ProbeResourceGuardTest --tests eu.faircode.netguard.ServiceSinkholeValidationBackoffTest: 11 tests passed.:app:lintGithubDebug: passed.git diff --check: passed.Related to #932.