Menu

#7 Avoid deadlock

open
nobody
None
5
2017-12-10
2017-12-10
No

At high network load a deadlock migh happen leaving balance hanging trying to write data to the server while the server also hangs trying to write data back to balance. Killing the client will leave the socket in a FIN_WAIT1 state. The problem is caused by the false assumption that only one file descriptor has data when select returns and this causes starvation of the server file descriptor. The attached patch fixes this by allways reading from all file descriptors that have new data after select returns. Maybe it would also be possible to fix this with better behaving servers and/or clients, but in my case this bug has been triggered with multiple levels of balance. That is balance has forwarded traffic to other load balancers using balance.

1 Attachments

Discussion


Log in to post a comment.

MongoDB Logo MongoDB