Skip to content

aclk: restore the t-rx timestamp in HTTP replies - #24252

Merged
stelfrag merged 1 commit into
netdata:masterfrom
stelfrag:fix-query-created-t-rx
Oct 19, 2026
Merged

stelfrag merged 1 commit into
netdata:masterfrom
stelfrag:fix-query-created-t-rx

Conversation

@stelfrag

@stelfrag stelfrag commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

#18218 removed _aclk_queue_query(), which set both query->created_tv and query->created, but moved only created_tv into aclk_query_new(). created is serialized as t-rx in every HTTP reply to Cloud, so it has been 0 since then.

This stamps created with now_realtime_usec() in aclk_query_new(), as before.

Tested on a live agent with a fake-Cloud harness that injects HTTP cmd messages through the real receive path and captures the reply headers (30 queries per build, success and invalid-request replies): master sends t-rx: 0 in every reply; with the fix t-rx is the receipt wall time, 3–37 ms after injection and under 1 ms before the reply.

Summary by CodeRabbit

  • Improvements
    • Queued queries now record both realtime and monotonic timestamps, improving the available timing information.

netdata#18218 dropped the assignment of query->created when it removed
_aclk_queue_query(), so every reply has sent t-rx: 0 since. Stamp it
in aclk_query_new() next to created_tv.
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f55f4c25-90af-49ee-90f8-ef241b039668


📥 Commits

Reviewing files that changed from the base of the PR and between 1af7795 and 17e6103.



📒 Files selected for processing (1)
  • src/aclk/aclk_query_queue.c


Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.




📝 Walkthrough
📝 Walkthrough

Walkthrough

aclk_query_new now records the query creation time in microseconds using the realtime clock. The existing monotonic timestamp remains.

Changes

ACLK query timestamp

Layer / File(s) Summary
Record query creation time
src/aclk/aclk_query_queue.c
aclk_query_new sets query->created to the current realtime time in microseconds.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix



Merge Risk: ⚪ Minimal · up to 17e61

Cloud query replies should include the restored receipt timestamp. The supplied change context indicates no actionable risk requiring a pre-merge fix.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: restoring the t-rx timestamp in HTTP replies by recording the query creation time.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

View guided diff | Re-trigger cubic

@stelfrag
stelfrag marked this pull request as ready for review October 11, 2026 22:00
@sonarqubecloud

Copy link
Copy Markdown

@stelfrag
stelfrag requested a review from thiagoftsm October 17, 2026 05:49

@thiagoftsm thiagoftsm 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.

Cloud is working as expected. LGTM!

@stelfrag
stelfrag merged commit 3ba16bb into netdata:master Oct 19, 2026
159 checks passed
@stelfrag
stelfrag deleted the fix-query-created-t-rx branch October 19, 2026 18:37
stelfrag added a commit to stelfrag/netdata that referenced this pull request Oct 23, 2026
netdata#18218 dropped the assignment of query->created when it removed
_aclk_queue_query(), so every reply has sent t-rx: 0 since. Stamp it
in aclk_query_new() next to created_tv.

(cherry picked from commit 3ba16bb)
@stelfrag stelfrag mentioned this pull request Oct 23, 2026
Ferroin pushed a commit that referenced this pull request Oct 23, 2026
#18218 dropped the assignment of query->created when it removed
_aclk_queue_query(), so every reply has sent t-rx: 0 since. Stamp it
in aclk_query_new() next to created_tv.

(cherry picked from commit 3ba16bb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants