You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When fork()ing a process having a Redis object, the child inherits the file descriptors.
To prevent a race, the child correctly refuses to use the inherited connections (see b8dd224). It thus calls close() on those fd-s (good), but also shutdown() (bad), thus breaking the socket for the parent.
Generally the difference between close() and shutdown() is: close()
closes the socket id for the process but the connection is still
opened if another process shares this socket id. The connection stays
opened both for read and write, and sometimes this is very important.
shutdown() breaks the connection for all processes sharing the socket
id. Those who try to read will detect EOF, and those who try to write
will reseive SIGPIPE, possibly delayed while the kernel socket buffer
will be filled.
The text was updated successfully, but these errors were encountered:
When fork()ing a process having a
Redis
object, the child inherits the file descriptors.To prevent a race, the child correctly refuses to use the inherited connections (see b8dd224). It thus calls
close()
on those fd-s (good), but alsoshutdown()
(bad), thus breaking the socket for the parent.See e.g. http://www.unixguide.net/network/socketfaq/2.6.shtml:
The text was updated successfully, but these errors were encountered: