Skip to content

MoQ stats gauge correction#209

Open
akash-a-n wants to merge 1 commit into
mainfrom
bugfix/moq-stats
Open

MoQ stats gauge correction#209
akash-a-n wants to merge 1 commit into
mainfrom
bugfix/moq-stats

Conversation

@akash-a-n
Copy link
Copy Markdown
Contributor

@akash-a-n akash-a-n commented Apr 16, 2026

removed unnecessary stats
correctly tracks the number of active publishers


This change is Reviewable

Copy link
Copy Markdown
Contributor Author

@akash-a-n akash-a-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed a bunch of namespace gauges that were inaccurately tracking the number of active publishNamespace and subscribeNamespace messages.
I have fixed a double decrement bug for pubActiveSubscribers -- (number of subscribers when session is a publisher)
I have fixed the non-decrementing issue with subActivePublishers -- (number of publishers when session is a subscriber)

@akash-a-n made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on afrind, gmarzot, michalhosna, mondain, Oxyd, peterchave, suhasHere, and TimEvens).

@gmarzot
Copy link
Copy Markdown
Contributor

gmarzot commented Apr 16, 2026

how does this PR relate to: openmoq/moxygen#148

independent?

Copy link
Copy Markdown
Contributor Author

@akash-a-n akash-a-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The third fix - for subActivePublishers needed changes in in both the layers moqx relay and in the underlying moxygen. #148 corresponds to the underlying change.

@akash-a-n made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on afrind, gmarzot, michalhosna, mondain, Oxyd, peterchave, suhasHere, and TimEvens).

@peterchave
Copy link
Copy Markdown

peterchave commented Apr 22, 2026

Has a fix for moqx_quicActiveStreams been looked at?
That guage appears to either not be incrementing or double decrementing?

Copy link
Copy Markdown

@peterchave peterchave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@peterchave reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on afrind, gmarzot, michalhosna, mondain, Oxyd, suhasHere, and TimEvens).

Copy link
Copy Markdown
Contributor Author

@akash-a-n akash-a-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look at moqx_quicActiveStreams

@akash-a-n made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on afrind, gmarzot, michalhosna, mondain, Oxyd, suhasHere, and TimEvens).

Copy link
Copy Markdown
Contributor Author

@akash-a-n akash-a-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it in #256

@akash-a-n made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on afrind, gmarzot, michalhosna, mondain, Oxyd, suhasHere, and TimEvens).

correctly tracks the number of active publishers
@afrind afrind force-pushed the bugfix/moq-stats branch from 5215548 to d1a27d3 Compare May 23, 2026 15:05
@afrind
Copy link
Copy Markdown
Contributor

afrind commented May 23, 2026

@akash-a-n I rebased/force-pushed this for you.

Claude noticed:

Potential bug — onSubscribeError decrements without a prior increment:

  void MoQStatsCollector::SubscriberCallback::onSubscribeSuccess() {
    ++parent_.subActivePublishers_;   // incremented only on success
  }

  void MoQStatsCollector::SubscriberCallback::onSubscribeError(...) {
    --parent_.subActivePublishers_;   // decremented on error — but was never incremented!
  }

onSubscribeSuccess and onSubscribeError are mutually exclusive terminal outcomes of a SUBSCRIBE. If a subscribe
fails (error, not success), subActivePublishers_ will go negative. The decrement on onSubscribeError should be
removed.

--

Potential double-decrement: Both onUnsubscribe and onPublishDone in SubscriberCallback decrement
subActivePublishers_. If the upstream always sends PUBLISH_DONE after an unsubscribe (as the
PublisherCallback::onUnsubscribe comment suggests is the case on the pub side), this would double-decrement for
the same subscription end. Worth verifying which events actually fire together on the subscriber side.

This sounds strange - pretty sure moxygen doesn't fire publshDone after the app unsubscribes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants