Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vm auth: if the request does not fully cache the body to buf due to server connection disconnection, it will not be retried. #6445

Open
shichanglin5 opened this issue Jun 9, 2024 · 4 comments
Assignees
Labels
bug Something isn't working vmauth waiting for release The change was merged to upstream, but wasn't released yet.

Comments

@shichanglin5
Copy link
Contributor

Describe the bug

description in comment:

func (rtb *readTrackingBody) canRetry() bool {
   if rtb.cannotRetry {
   	return false
   }
// if the request does not fully cache the body to buf 
// due to server connection disconnection, it will not be retried.
   if len(rtb.buf) > 0 && !rtb.needReadBuf {
   	return false
   }
   return true
}

log

2024-06-06T20:30:37+08:00 2024-06-06T12:30:37.396Z	warn	VictoriaMetrics/app/vmauth/main.go:268	remoteAddr: "172.26.13.17:64104, X-Forwarded-For: 10.214.137.216"; requestURI: /api/v1/push?job=skyeye-skynet; cannot proxy the request to http://10-205-89-19.vminsert-skyeye.vm-cluster-skyeye.svc.cluster.local.:8480/insert/2:6/prometheus/api/v1/push?job=skyeye-skynet: readfrom tcp 10.205.89.16:42960->10.205.89.19:8480: write tcp 10.205.89.16:42960->10.205.89.19:8480: write: broken pipe

To Reproduce

  1. do request with partial read body to buf
  2. close client-server connection
  3. log cannot proxy the request to xxx

Version

I built it with source code:
git revision: 1a1ee87

Logs

2024-06-06T20:30:37+08:00 2024-06-06T12:30:37.396Z warn VictoriaMetrics/app/vmauth/main.go:268 remoteAddr: "172.26.13.17:64104, X-Forwarded-For: 10.214.137.216"; requestURI: /api/v1/push?job=skyeye-skynet; cannot proxy the request to http://10-205-89-19.vminsert-skyeye.vm-cluster-skyeye.svc.cluster.local.:8480/insert/2:6/prometheus/api/v1/push?job=skyeye-skynet: readfrom tcp 10.205.89.16:42960->10.205.89.19:8480: write tcp 10.205.89.16:42960->10.205.89.19:8480: write: broken pipe

Screenshots

No response

Used command-line flags

No response

Additional information

No response

@shichanglin5 shichanglin5 added the bug Something isn't working label Jun 9, 2024
@shichanglin5
Copy link
Contributor Author

In addition, I have observed that vm auth monitoring, go gc accounts for a relatively high proportion( 50%), and perhaps gc can be reduced by reusing buf to avoid frequent memory allocation.
image

@Amper Amper self-assigned this Jun 10, 2024
@Amper Amper added the vmauth label Jun 10, 2024
hagen1778 pushed a commit that referenced this issue Jul 2, 2024
follow up #6446

issue: #6445

---------

Signed-off-by: f41gh7 <nik@victoriametrics.com>
Co-authored-by: f41gh7 <nik@victoriametrics.com>
@hagen1778 hagen1778 added the waiting for release The change was merged to upstream, but wasn't released yet. label Jul 2, 2024
@hagen1778
Copy link
Collaborator

#6533 has been merged and will be included into the next release.

hagen1778 pushed a commit that referenced this issue Jul 2, 2024
follow up #6446

issue: #6445

---------

Signed-off-by: f41gh7 <nik@victoriametrics.com>
Co-authored-by: f41gh7 <nik@victoriametrics.com>
(cherry picked from commit 4d66e04)
@shichanglin5
Copy link
Contributor Author

good!

@f41gh7
Copy link
Contributor

f41gh7 commented Jul 2, 2024

We keep issues open until actual release. So re-opening it.

@f41gh7 f41gh7 reopened this Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vmauth waiting for release The change was merged to upstream, but wasn't released yet.
Projects
None yet
Development

No branches or pull requests

4 participants