Fix file descriptor being closed twice
This was leading to us closing fd that was in use by other routine and thus causing problems in singlepoll code that should never have same fd parked twice. The cause was following: If FileConn failed due to lack of free fd's for Dup operation we were calling Close syscall to close the fd. This fd was previously passed to os.NewFile which causes Golang to add finalizer for closing that fd. If memory, file descriptor and connection pressure were right, Golang was closing fd that was being parked on, which in turns meant that we could get the same fd in the dial code, which would be parked again causing the singlepoller to enter undefined state.
Showing
Please register or sign in to comment