Skip to content

Conversation

@djshow832
Copy link
Collaborator

What problem does this PR solve?

Issue Number: close #752

Problem Summary:
The status is fetched before the handler is called, so the status is always 200.

What is changed and how it works:
Fetch the status after the handler is called. Besides, remove path and end because they can be inferred from somewhere else.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code
[2025/03/06 10:18:57.550 +08:00] [DEBUG] [main.api] [api/server.go:166] [/api/traffic/capture]  [status=500] [method=POST] [query=] [ip=127.0.0.1] [user-agent=Go-http-client/1.1] [latency=187.75µs]

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change
  • Has tiproxyctl change
  • Other user behavior changes

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

- Fix wrong status in the API debug log

@ti-chi-bot ti-chi-bot bot requested review from bb7133 and xhebox March 6, 2025 02:26
@ti-chi-bot ti-chi-bot bot added the size/S label Mar 6, 2025
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@968d316). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #753   +/-   ##
=======================================
  Coverage        ?   66.31%           
=======================================
  Files           ?      126           
  Lines           ?    11615           
  Branches        ?        0           
=======================================
  Hits            ?     7703           
  Misses          ?     3354           
  Partials        ?      558           
Flag Coverage Δ
unit 66.31% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ti-chi-bot ti-chi-bot bot added the lgtm label Mar 6, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Mar 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xhebox

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot
Copy link

ti-chi-bot bot commented Mar 6, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-03-06 07:45:12.590575168 +0000 UTC m=+514025.719494914: ☑️ agreed by xhebox.

@ti-chi-bot ti-chi-bot bot added the approved label Mar 6, 2025
@ti-chi-bot ti-chi-bot bot merged commit 50dfbf0 into pingcap:main Mar 6, 2025
5 checks passed
@djshow832 djshow832 deleted the fix_debug branch March 6, 2025 08:05
@djshow832
Copy link
Collaborator Author

/cherry-pick release-1.3

@ti-chi-bot
Copy link
Member

@djshow832: new pull request created to branch release-1.3: #782.

Details

In response to this:

/cherry-pick release-1.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

ti-chi-bot bot pushed a commit that referenced this pull request May 7, 2025
Co-authored-by: djshow832 <zhangming@pingcap.com>
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.

TiProxy always logs status=200 for the HTTP API

4 participants