Skip to content

Conversation

ndyakov
Copy link
Member

@ndyakov ndyakov commented Sep 19, 2025

No description provided.

@ndyakov ndyakov force-pushed the ndyakov/CAE-1242-e2e-hitless branch from 5c5d4dc to 988f712 Compare September 19, 2025 11:24
// Atomically decrement counter and check if we should clear
newCount := cn.relaxedCounter.Add(-1)
if newCount <= 0 {
deadlineNs := cn.relaxedDeadlineNs.Load()
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nitpick, could we rename it to epochDeadlineNs?
Currently, it is a bit confusing, and my initial assumption was that it's a relative value

newCount := cn.relaxedCounter.Add(-1)
if newCount <= 0 {
deadlineNs := cn.relaxedDeadlineNs.Load()
if newCount <= 0 && (deadlineNs == 0 || time.Now().UnixNano() >= deadlineNs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the deadlineNs == 0 a bit redundant?

return
case <-ctx.Done():
return
default:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this leftover?

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.

2 participants