+++ This bug was initially created as a clone of Bug #1666143 +++ Description of problem: Found the return value of socket pollin and pollout for rpc message is not correctly handled. One major problem is socket EAGAIN error will be returned all the way back to dispatch handler and confuse user with error message like: [2018-12-29 07:31:41.772310] E [MSGID: 101191] [event-epoll.c:674:event_dispatch_epoll_worker] 0-epoll: Failed to dispatch handler Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: --- Additional comment from Worker Ant on 2019-01-15 07:25:53 IST --- REVIEW: https://review.gluster.org/22043 (socket: fix counting of socket total_bytes_read and total_bytes_write) posted (#1) for review on master by Zhang Huan --- Additional comment from Worker Ant on 2019-01-15 07:27:04 IST --- REVIEW: https://review.gluster.org/22044 (socket: fix issue when socket write return with EAGAIN) posted (#1) for review on master by Zhang Huan --- Additional comment from Worker Ant on 2019-01-15 07:28:10 IST --- REVIEW: https://review.gluster.org/22046 (socket: don't pass return value from protocol handler to event handler) posted (#1) for review on master by Zhang Huan --- Additional comment from Worker Ant on 2019-01-15 07:29:19 IST --- REVIEW: https://review.gluster.org/22045 (socket: fix issue when socket read return with EAGAIN) posted (#1) for review on master by Zhang Huan --- Additional comment from Worker Ant on 2019-01-17 14:00:17 IST --- REVIEW: https://review.gluster.org/22043 (socket: fix counting of socket total_bytes_read and total_bytes_write) merged (#2) on master by Raghavendra G --- Additional comment from Worker Ant on 2019-01-17 14:00:40 IST --- REVIEW: https://review.gluster.org/22044 (socket: fix issue when socket write return with EAGAIN) merged (#2) on master by Raghavendra G --- Additional comment from Worker Ant on 2019-01-22 12:23:12 IST --- REVIEW: https://review.gluster.org/22045 (socket: fix issue when socket read return with EAGAIN) merged (#2) on master by Amar Tumballi --- Additional comment from Worker Ant on 2019-01-22 12:30:25 IST --- REVIEW: https://review.gluster.org/22046 (socket: don't pass return value from protocol handler to event handler) merged (#3) on master by Amar Tumballi