Xiaochen Wang

Results 287 comments of Xiaochen Wang

这似乎是源码上讨论的问题, > [内存泄漏,fail时需调用ngx_slab_free_locked(shpool, peer_shm[index].sockaddr)](https://github.com/alibaba/tengine/blob/master/modules/ngx_http_upstream_check_module/ngx_http_upstream_check_module.c#L1249) 这个逻辑是 1. 共享内存加锁 2. 操作共享内存 3. 如果步骤2异常需要退出(引用代码处),则把共享内存锁摘除,防止其他进程 运行此逻辑锁死。 所以这里不确定你遇到什么问题。这个逻辑如果不解锁反而异常

> - [访问共享内存时数据时没有加锁保护 1](https://github.com/alibaba/tengine/blob/master/modules/ngx_http_upstream_check_module/ngx_http_upstream_check_module.c#L1514) > - [访问共享内存时数据时没有加锁保护 2](https://github.com/alibaba/tengine/blob/master/modules/ngx_http_upstream_check_module/ngx_http_upstream_check_module.c#L1484) > - [共享内存锁(shpool->mutex)和节点锁存在使用混乱 1](https://github.com/alibaba/tengine/blob/master/modules/ngx_http_upstream_check_module/ngx_http_upstream_check_module.c#L1370) > - [共享内存锁(shpool->mutex)和节点锁存在使用混乱 2](https://github.com/alibaba/tengine/blob/master/modules/ngx_http_upstream_check_module/ngx_http_upstream_check_module.c#L1187) 这里严谨的需要全部加锁。但是因为估计当初逻辑是再通用硬件上操作,默认原子操作cmp和inc。这里标记TODO估计也有考虑这个。

> > > * [访问共享内存时数据时没有加锁保护 1](https://github.com/alibaba/tengine/blob/master/modules/ngx_http_upstream_check_module/ngx_http_upstream_check_module.c#L1514) > > > * [访问共享内存时数据时没有加锁保护 2](https://github.com/alibaba/tengine/blob/master/modules/ngx_http_upstream_check_module/ngx_http_upstream_check_module.c#L1484) > > > * [共享内存锁(shpool->mutex)和节点锁存在使用混乱 1](https://github.com/alibaba/tengine/blob/master/modules/ngx_http_upstream_check_module/ngx_http_upstream_check_module.c#L1370) > > > * [共享内存锁(shpool->mutex)和节点锁存在使用混乱 2](https://github.com/alibaba/tengine/blob/master/modules/ngx_http_upstream_check_module/ngx_http_upstream_check_module.c#L1187) > > > > > >...

mark as stale, if you still have issue, feel free to reopen it.

mark as stale

mark it as stale

This module could not do this, its only used as pure HTTP tunnel proxy, just proxying the raw data in the HTTP tunnel.

I'm closing this for now. Feel free to reopen or create a new one if you have any further issues.

> @samugi , do we have any updates? Already pinged our PM to review this issue