theweakgod opened a new pull request, #10342:
URL: https://github.com/apache/apisix/pull/10342
### Description
config.yaml:
discovery:
consul:
servers:
- "http://localhost:8500"
keepalive: true
使用consul服务发现存在进程泄漏,在reload或者quit时,会存在一个shutting down并且永远不会关的nginx进程。
当nginx reload时,开启了keepalive的consul worker不会正常退出,而是处于shutting
down状态,并且会一直访问consul的health api。
只需要在创建新timer前进行判断即可解决进程泄漏。
在keepalive为false时不会存在这个问题,但是会有明显的内存泄漏。
复现方法,开启与consul 服务发现,并且`apisix reload`
htop -p $(pgrep -d',' -f "nginx")
查看进程,会存在 worker process is shutting down。
<img width="831" alt="image"
src="https://github.com/apache/apisix/assets/47879179/bb46a8cc-01ae-4fe6-9f66-a42ff66cfc5f">
改进程会一直存在
Fixes # (issue)
### 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](https://github.com/apache/apisix/tree/master#community) first)
<!--
Note
1. Mark the PR as draft until it's ready to be reviewed.
2. Always add/update tests for any changes unless you have a good reason.
3. Always update the documentation to reflect the changes made in the PR.
4. Make a new commit to resolve conversations instead of `push -f`.
5. To resolve merge conflicts, merge master instead of rebasing.
6. Use "request review" to notify the reviewer after making changes.
7. Only a reviewer can mark a conversation as resolved.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]