David Chen <chenzhuowan...@163.com> added the comment:

After some investigation, i almost finally identified the root cause - it was 
caused by the following line in `Server` class in `manager.py` file:
```
self.listener = Listener(address=address, backlog=16)
```
i'm not sure where the magic number `16` came from, but it turned out it was 
not big enough for some powerful CPU(48 cores in my case), where the socket 
server starts refusing to accepting new connections if there are more than `16` 
unaccepted connections, i think this is why the code stuck at `Client -> 
answer_challenge` where attempting to create new connection to the server. 
After i change the number to `32`, this issue is gone.
IMO, a magic number here is not very suitable, maybe we could make this number 
configurable or use `cpu_count` to set it to a better number based on the CPU 
count.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44155>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to