numam-spdk/lib
Seth Howell 74c9fd40fd sock: keep track of removed sockets during call to poll
We have been intermittently hitting the assert where
we check sock->cb_fn != NULL in spdk_sock_group_impl_poll_count.

The only way we could be hitting this specific error is if we
wereremoving a socket from a sock group within after receiving
an event for it.

Specifically, we are seeing this error on the NVMe-oF TCP target
which relies on posix sockets using epoll.

The man page for epoll states the following:

 If you use an event cache or store all the file descriptors
 returned from epoll_wait(2), then make sure to provide
 a  way  to  mark its closure dynamically (i.e., caused by
 a previous event's processing).  Suppose you receive 100 events
 from epoll_wait(2), and in event #47 a condition causes event
 #13 to be closed.  If you remove  the  structure  and close(2)
 the file descriptor for event #13, then your event cache might
 still say there are events waiting for that file descriptor
 causing confusion.

 One solution for this is to call, during the processing
 of  event  47,  epoll_ctl(EPOLL_CTL_DEL)  to  delete  file
 descriptor  13 and close(2), then mark its associated data
 structure as removed and link it to a cleanup list.  If
 you find another event for file descriptor 13 in your batch
 processing, you will discover the file descriptor  had
 been previously removed and there will be no confusion.

Since we do store all of the file descriptors returned from
epoll_wait, we need to implement the tracking mentioned above.

fixes issue #1294

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ib592ce19e3f0b691e3a825d02ebb42d7338e3ceb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1589
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
(cherry picked from commit e71e81b631)
2020-07-05 14:53:47 +09:00
..
bdev nvme: fix command specific status code 2020-03-19 08:09:53 +00:00
blob lib/blob: merge EP of a clone when deleting a snapshot 2020-05-29 08:27:18 +00:00
blobfs blobfs: write IO directly if it is lba aligned 2020-01-07 12:19:14 +00:00
conf string: spdk_strtol to delegate additional error checking 2019-01-29 00:10:57 +00:00
copy lib/copy: move ioat subdir to module directory. 2019-08-22 16:29:49 +00:00
env_dpdk dpdkbuild: add support for DPDK 20.05 2020-06-01 17:50:18 +00:00
env_ocf lib/bdev/ocf: update of ocf library to version 19.06 2019-10-22 17:22:41 +00:00
event lib/app: Change signal handler to use spdk_thread_send_critical_msg 2020-01-13 12:42:49 +00:00
ftl lib/ftl: Change "lbk" name to "block" 2020-01-17 08:59:08 +00:00
ioat lib/ioat: Fix the error message when enabling ioat during application shutdown. 2019-12-30 03:09:01 +00:00
iscsi lib/iscsi: Return when connection state is already exited at login completion 2020-03-19 08:09:53 +00:00
json json_util: fix typo in debug message. 2019-05-31 14:39:53 +00:00
jsonrpc json: increase the json rpc client value limit 2019-11-18 13:16:49 +00:00
log lib/log: passing va_list to user-provided log call 2019-10-09 14:35:51 +00:00
log_rpc RPC: rename get_log_flags to log_get_flags 2019-09-24 16:42:41 +00:00
lvol lib/blob: store clear_method in per blob metadata 2020-01-20 09:57:16 +00:00
nbd rpc: Rename get_nbd_disks to nbd_get_disks 2019-09-19 20:56:35 +00:00
net net: add the check for the add and delete IP operation 2019-12-09 17:39:50 +00:00
notify RPC: rename get_notifications to notify_get_notifications 2019-09-24 16:42:41 +00:00
nvme nvme: create netlink socket during nvme_driver_init 2020-06-01 17:50:18 +00:00
nvmf rdma: Fix Segmentation fault when not sufficient memory for RDMA queue. 2020-03-19 08:09:53 +00:00
reduce lib/reduce: move _alloc_zero_buf earlier in init stage. 2019-12-19 11:04:57 +00:00
rocksdb RocksDB: Remove static and assert for SpdkInitializeThread 2019-07-05 04:19:11 +00:00
rpc RPC: properly set the address in error cases 2019-12-04 15:11:55 +00:00
rte_vhost vhost: make SPDK internal vhost library can work compatible with live recovery 2020-01-22 13:54:19 +00:00
scsi lib/scsi: Move scsi_task_free_data() in a file to remove function declaration 2019-11-21 08:01:29 +00:00
sock sock: keep track of removed sockets during call to poll 2020-07-05 14:53:47 +09:00
thread thread: free message event after executing the callback successfully 2020-01-22 01:25:03 +00:00
trace trace: fix calculation of histories_size 2019-11-06 15:19:48 +00:00
ut_mock test: Add mocks for sendmsg and recvmsg 2019-11-01 17:56:16 +00:00
util util: Add spdk_iovcpy, an iovec to iovec copy function. 2019-11-20 09:35:32 +00:00
vhost vhost: Fix the issue of virtual machine device parameter max_segments always equal to 1 2020-05-25 15:42:26 +00:00
virtio virtio_user: use correct #ifndef for the internal vhost.h header 2020-01-10 08:45:45 +00:00
vmd lib/vmd: track hotplug memory usage 2019-12-12 14:52:59 +00:00
Makefile make: add dependencies for the rte_vhost build. 2019-09-09 22:15:24 +00:00