apisix icon indicating copy to clipboard operation
apisix copied to clipboard

bug: http connections not closed in http-logger plugin

Open markokocic opened this issue 1 year ago • 0 comments

Current Behavior

We set up a http-logger to send requests to ActiveMQ using the http protocol. After some time, we noticed that the ActiveMQ hangs and is not responsible any more.

After some investigation, we found out that the number of open connections between APISIX and ActiveMQ is increasing.

Currently in our system, we have ~150 connection in ESTABLISHED, TIME_WAIT, LAST_ACK and CLOSE_WAIT states. By increasing load on APISIX, this number increase.

By examining the source code for http-logger.lua, I can observe that http connection is opened, but never closed, which could lead to the connection leak when we have largen number of requests.

Expected Behavior

No response

Error Logs

No response

Steps to Reproduce

  1. Configure http-logger plugin to send request data to ActiveMQ http endpoint
  2. Run stress test on APISIX
  3. Observe number of open http connections between APISIX and ActiveMQ

Environment

  • APISIX version 3.9

markokocic avatar Jul 30 '24 08:07 markokocic