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

fix: httpc connection close #11450

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

madhawa-gunasekara
Copy link
Member

Description

This will close httpc connection. We observed too many connections in activemq.

Fixes #11449

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@shreemaan-abhishek
Copy link
Contributor

great catch 🙏🏼 , could you please check if this bug exists in other plugins/places too?

@madhawa-gunasekara madhawa-gunasekara force-pushed the issue-11449 branch 2 times, most recently from c331336 to 72ca229 Compare July 31, 2024 11:59
Copy link
Contributor

@zhoujiexiong zhoujiexiong left a comment

Choose a reason for hiding this comment

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

What about reusing socket by request_uri + keepalive instead of new + close socket every time?

like plugins/forward-auth:
image

@@ -60,7 +61,7 @@ local function fetch_access_token(code, conf)
["Content-Type"] = "application/x-www-form-urlencoded"
}
})

connection_util.close_http_connection(client)
Copy link
Contributor

Choose a reason for hiding this comment

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

request_uri will close(sock) before returning, so this line is not necessary? The same is true elsewhere of the PR.

image

Copy link
Member Author

Choose a reason for hiding this comment

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

+1 will remove it.

@shreemaan-abhishek
Copy link
Contributor

@madhawa-gunasekara, please avoid force pushing 🙂 I have told this before.

@zhoujiexiong
Copy link
Contributor

Ping @madhawa-gunasekara :D

@zhoujiexiong
Copy link
Contributor

Ping @madhawa-gunasekara

:D

@madhawa-gunasekara
Copy link
Member Author

Hi @zhoujiexiong,

I was traveling, I will push the changes. :)

@zhoujiexiong zhoujiexiong mentioned this pull request Sep 4, 2024
5 tasks
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 24, 2024
@madhawa-gunasekara
Copy link
Member Author

@zhoujiexiong I did the changes.. please review

@madhawa-gunasekara
Copy link
Member Author

@zhoujiexiong Ping, any chance to look into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: http connections not closed in http-logger plugin
3 participants