To see what sockets were active,
sudo netstat -ltnpFrom there, with the pid in hand,
sudo strace -s 3000 -f -p <PID>Searching for socket related system calls I was able to get a sense of what was going on. If just wanted to look at network traffic then -e trace=network would have been appropriate.
In this case my application was stuck on recv(6, , ,, where a socket was established but not receiving any information. Since I was using the basic Flask webserver things were single threaded and the app could not return to serving static pages again. The solution here is to shutdown the hanging socket and let the app serve pages as normal...
The socket was shut down with gdb:
#sudo apt-get install python3-dbg gdbWith the symbol table loaded we can use the shutdown command with,
sudo gdb python3 <PID>
call shutdown(6, 2) # safely shutsdown socket, even for multithreaded applications
No comments:
Post a Comment