Commit 5eb7f01
committed
docker-proxy cannot exit after send SIGINT
Signed-off-by: mingfukuang <kuang.mingfu@zte.com.cn>
When stop or delete one container with docker-proxy, stop container will call Unmap() to release port ,
func Unmap() need to acquire pm.lock.Lock() firstly, then stop docker-proxy, and then pm.lock.UnLock().
but some situation(cannot be reproduced), stop docker-proxy will hang on.
Once one container cann't stop docker-proxy, above mentioned pm.lock cann't be released, so this container cann’t be stopped,
Also all operation of this container could be hang on. Furthermore, if other containers enter stop or delete process,
those containers also need to acquire the global pm.lock, and get stuck.
As result, other operations to those containers also hang on, such as docker inspect, docker exec, etc.
To fix this, I add protective measures to avoid the situation of global lock(pm.lock)cann't being released.1 parent 3fb133e commit 5eb7f01
1 file changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
72 | 89 | | |
73 | 90 | | |
74 | 91 | | |
| |||
0 commit comments