Skip to content

Various perf updates and fixes - #194

Merged
TimEvens merged 9 commits into
mainfrom
perf-updates
Sep 29, 2026
Merged

TimEvens merged 9 commits into
mainfrom
perf-updates

Conversation

@TimEvens

Copy link
Copy Markdown
Collaborator
  • Fixes lingering publish namespace publish tracks, they are now removed on publish done
  • Fixes excessive call to namespace handler for top-n
  • Updates refresh ranking interval to 500ms

* Fixes lingering publish namespace publish tracks, they are now
  removed on publish done
* Fixes excessive call to namespace handler for top-n
* Updates refresh ranking interval to 500ms
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-18T19:35:03.007266Z fe9dc4f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe9dc4fb05

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/client_manager.cc
continue;
}

pub_ns_h->UnpublishTrack(pub_ta);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep shared tracks until the last publisher finishes

When two connections publish the same full track name, they share pub_ta, and the code immediately above explicitly detects that another publisher remains via have_publishers. This unconditional erase nevertheless removes the shared track from every matching namespace handler when either publisher sends PUBLISH_DONE; later ranking updates report the alias as missing and cannot select or resume the remaining live publication. Only unpublish when have_publishers is false, or rebind the namespace entry to a remaining publisher.

Useful? React with 👍 / 👎.

Comment on lines 188 to +193
if (cur_tick - track.last_updated_tick > delay_publish_done_ms_) {
SPDLOG_INFO("Unpublish track, not in top-n track alias: {} conn_id: {} ticks: {} < {}",
ta,
GetConnectionId(),
track.last_updated_tick,
cur_tick);
remove_publish_tracks.push_back(ta);
SPDLOG_TRACE("Unpublish track, not in top-n track alias: {} conn_id: {} ticks: {} < {}",
ta,
GetConnectionId(),
track.last_updated_tick,
cur_tick);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve cleanup for teardown paths without PUBLISH_DONE

This branch now only logs once a paused track exceeds the cleanup delay, while the sole new UnpublishTrack call is in PublishDoneReceived. If a publisher disconnects abruptly or ends a publish namespace, the existing teardown paths remove it from client state without invoking that callback, leaving its alias in published_tracks_; a later publisher of the same alias cannot replace the stale entry because PublishTrack uses emplace, so ranking can continue using an obsolete or expired handler. Wire those teardown paths to UnpublishTrack or retain the delayed erase as a fallback.

Useful? React with 👍 / 👎.

@TimEvens
TimEvens merged commit 7865e35 into main Sep 29, 2026
2 checks passed
@TimEvens
TimEvens deleted the perf-updates branch September 29, 2026 16:19
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.

1 participant