fix: replace single-IP ping with multi-method internet check#358
Merged
fix: replace single-IP ping with multi-method internet check#358
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #358 +/- ##
========================================
Coverage 73.85% 73.85%
========================================
Files 6 6
Lines 631 631
========================================
Hits 466 466
Misses 165 165
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
MateoLostanlen
previously approved these changes
Apr 27, 2026
Member
MateoLostanlen
left a comment
There was a problem hiding this comment.
Small efficiency comment but ok for me, thanks
Member
Author
|
Fixed @MateoLostanlen , can you approve and I merge after :) ? |
Member
|
hi @fe51 can you fix style first ? |
Member
Author
|
done @MateoLostanlen ! thanks for the catch |
MateoLostanlen
approved these changes
Apr 27, 2026
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.
Pitch
ICMP ping to public IPs (1.1.1.1, 8.8.8.8) can be blocked on mobile/4G networks even when real internet access works. This caused false-positive internet failures on some watchdog CRON run
Modifications
Replaces ping_host(INTERNET_IP) with internet_check_ok() which tries lightweight HTTP/HTTPS probes first (generate_204 endpoints) and falls back to pinging multiple IPs only if all HTTP checks fail. No new dependencies — uses stdlib urllib.request.
Hypothesis
ICMP — Internet Control Message Protocol is a low-level network protocol used for diagnostics (ping, traceroute, "host unreachable" messages). It operates below TCP/UDP — no ports, just raw IP packets with a type field.
Why operators might block it:
HTTP/HTTPS traffic on port 443 is virtually never blocked because that would break the entire web — which is why it's a more reliable signal for "internet is actually working."