Repository navigation
fix: udp:// slots read the socket on a thread of their own; no slot checks during a push (#251) #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
fix: udp:// slots read the socket on a thread of their own; no slot checks during a push (#251) #252
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b98205c
fix: udp:// slots read the socket on a thread of their own; no slot c…
compot-dev 21d86e3
2.18.3: udp:// receive thread, no slot checks during a push (#251)
compot-dev ebf5785
fix: udp:// listener review fixes — batches, published counters, prob…
compot-dev 8882ce6
fix: rtp_lost keeps losses of a long jump and of earlier video types …
compot-dev 926ecd9
fix: socket_drops counts this listener's socket only; held probes say…
compot-dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1170,6 +1170,8 @@ public void run() { | |
| v.setVisibility(showStats ? View.VISIBLE : View.GONE); | ||
| if (log) Log.i(TAG, "Quad-" + i + ": " + line); | ||
| } | ||
| // Not only on debug requests: a push that starts ends the checks within a second | ||
| streamProbes.hold(pushReceived()); | ||
| checkDecoderStuck(cells); | ||
| planDecoding(cells, now); | ||
| updateDebugUrls(); | ||
|
|
@@ -1697,6 +1699,9 @@ private Map<String, Object> debugState() { | |
| if (jl != null) c.put("jieli", jl); | ||
| Map<String, Object> hb = cell.heartbeatStats(); | ||
| if (hb != null) c.put("heartbeat", hb); | ||
| // A udp:// push: a full socket buffer or ring, or loss on the way (#251) | ||
| Map<String, Object> udp = cell.udpListenStats(); | ||
| if (udp != null) c.put("udp", udp); | ||
| if (cell.rotate() != 0) c.put("rotate", cell.rotate()); | ||
| if (cell.mirror()) { | ||
| c.put("mirror", true); | ||
|
|
@@ -1723,8 +1728,20 @@ private void updateProbes() { | |
| urls[i] = mHosts[i] != null && !mHosts[i].isEmpty() && !mHosts[i].equals(DEFAULT_URL) | ||
| ? mHosts[i] : null; | ||
| } | ||
| boolean push = pushReceived(); | ||
| streamProbes.hold(push); | ||
| streamProbes.update(urls, mTransports, udpViewShown ? null : mHost, | ||
| mResumed && (udpViewShown || !quadEnabled)); | ||
| mResumed && (udpViewShown ? !push : !quadEnabled)); | ||
| } | ||
|
|
||
| /** | ||
| * The U cell receives a push: no checks of other cameras then, their RTSP sessions made | ||
| * the box drop datagrams of the push (#251). | ||
| */ | ||
| private boolean pushReceived() { | ||
| QuadCell[] cells = quadCells; | ||
| QuadCell u = udpViewShown && cells != null ? cells[U_CELL] : null; | ||
| return u != null && u.isConnected(); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -1754,7 +1771,9 @@ private String probeText(int i, long nowMs) { | |
| if (skip != null) return skip; | ||
| StreamProbe.Result r = probeResult(i); | ||
| if (r != null) return r.text(nowMs) + (streamProbes.isRunning(i) ? " \u00b7 checking" : ""); | ||
| return streamProbes.isRunning(i) ? "Checking stream\u2026" : "Waiting for a stream check"; | ||
| if (streamProbes.isRunning(i)) return "Checking stream\u2026"; | ||
| return pushReceived() ? "Not checked while the U cell receives a push" | ||
| : "Waiting for a stream check"; | ||
|
Comment on lines
+1775
to
+1776
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 8. Pushes leave probe state marked waiting probeText() now says a slot is not checked during a U-cell push, but probeSlots() still assigns that slot's probe.state to waiting when it has no previous result. During a push, consumers of /stats.json receive contradictory text and state for the same slot, despite probing being held. Agent Prompt
|
||
| } | ||
|
|
||
| /** | ||
|
|
@@ -1818,8 +1837,9 @@ private List<Object> probeSlots() { | |
| StreamProbe.Result r = probeResult(i); | ||
| Map<String, Object> p = new LinkedHashMap<>(); | ||
| p.put("state", r != null ? (r.ok ? "ok" : "error") | ||
| : streamProbes.isRunning(i) ? "checking" : u || StreamProbes.skipReason( | ||
| mHosts[i], DEFAULT_URL, udpViewShown ? null : mHost) != null | ||
| : streamProbes.isRunning(i) ? "checking" : u || pushReceived() | ||
| || StreamProbes.skipReason(mHosts[i], DEFAULT_URL, | ||
| udpViewShown ? null : mHost) != null | ||
| ? "not checked" : "waiting"); | ||
| if (r != null) { | ||
| p.put("checked_s_ago", (now - r.atMs) / 1000); | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.