Skip to content

cherry pick three commits from v13 to v14 - #339

Merged
JacksonYao287 merged 5 commits into
eBay:dev/v14.xfrom
JacksonYao287:cherry-pick
Oct 9, 2026
Merged

JacksonYao287 merged 5 commits into
eBay:dev/v14.xfrom
JacksonYao287:cherry-pick

Conversation

@JacksonYao287

@JacksonYao287 JacksonYao287 commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

this PR cherry pick three commits from v13 to v14, no new logic change

xiaoxichen and others added 4 commits October 8, 2026 11:30
Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>
Histogram observations above the largest configured boundary use the implicit overflow bucket at index
boundaries.size(). RCU and thread-buffer aggregation previously omitted that slot during merge, leaving the sum
updated while count and the Prometheus +Inf bucket were too low. The atomic implementation discarded these
observations entirely.

Account for the implicit overflow bucket in every implementation, validate that configured boundaries fit the fixed
histogram storage, and cover below-boundary, exact-boundary, and overflow observations across all backends and
Prometheus output.
@JacksonYao287
JacksonYao287 disabled auto-merge October 8, 2026 04:45
@JacksonYao287 JacksonYao287 changed the title Cherry pick cherry pick three commits from v13 to v14 Oct 8, 2026
Comment thread src/watchdog/CMakeLists.txt

private:
friend class WatchdogRegistry;
WatchdogRegistry* registry_{nullptr};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nothing detaches live watchdogs when the registry goes away. If a Watchdog outlives the registry, it accesses nullptrs at shutdown and crashes.


Watchdog::~Watchdog() {
if (registry_ == nullptr) { return; }
registry_->remove(id_);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

May be a race/use-after-free here. Watchdog only removes itself from the registry in the base destructor, which runs after the derived classes have already been destroyed. When LeaseWatchdog is destroyed, ~DeadlineWatchdog() runs and frees name_. Another thread being in the middle of failures() and calls check(), it's dealing with half-destroyed object, e.g. accessing name_ is use-after-free.

std::vector< WatchdogFailure > WatchdogRegistry::failures() const {
std::vector< WatchdogFailure > out;
auto const now = std::chrono::steady_clock::now();
std::lock_guard< std::mutex > lock(mu_);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is it possible to deadlock here if a subclass calls failures() while the lock is held?

@JacksonYao287

Copy link
Copy Markdown
Member Author

@nnastonen thanks for the nice finding. I have updated this PR to address your comments. ptal

@Besroy can you also take a look at the change of watchdog?

@JacksonYao287
JacksonYao287 requested a review from Besroy October 9, 2026 02:28

@Besroy Besroy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks for the review and fix!

@JacksonYao287
JacksonYao287 merged commit 10f0f8a into eBay:dev/v14.x Oct 9, 2026
5 checks passed
@JacksonYao287
JacksonYao287 deleted the cherry-pick branch October 9, 2026 07: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.

4 participants