Fail the fio job instead of hanging when out of open files #207
Open
koolkhel
wants to merge 2 commits from
koolkhel/vitastor:fio-out-of-fds into master
pull from: koolkhel/vitastor:fio-out-of-fds
merge into: vitalif:master
vitalif:master
vitalif:primary-stickiness
vitalif:libvfn
vitalif:canceling
vitalif:immediate-repeering
vitalif:rdma-close-tcp
vitalif:use-degraded-writes
vitalif:fix-write-delete-flow
vitalif:openssl-3.0.12
vitalif:openssl-capture-secrets
vitalif:ignore-small-rdma-end
vitalif:encrypt-batch
vitalif:faster-peering-calc
vitalif:http-hello
vitalif:xxh3-bench
vitalif:create-user-etcd-based
vitalif:aesxts_streaming_nosupport
vitalif:refactor-heap-continue-write
vitalif:ston3lu-patch-0127
vitalif:rdma-credits
vitalif:heap-meta
vitalif:sendmsg-zc-no-more-error
vitalif:fix-clear-refs
vitalif:veeam-trick
vitalif:test-etcd-schizo
vitalif:test
vitalif:test1
vitalif:test2
vitalif:cow-meta
vitalif:kv-readahead
vitalif:qemu-fix-crash-idea
vitalif:eventloop-auto-init-trigger
vitalif:hugo-docs
vitalif:node-mutex-and-postpone
vitalif:check-writeback
vitalif:msgr-iothreads-v2
vitalif:antietcd
vitalif:rel-1.4
vitalif:test-fix-ec-unknown-state-51
vitalif:kv-update
vitalif:kv-debug
vitalif:hotfix-1.2.0
vitalif:rdma-simple-nodp
vitalif:zerocopy-tcp-send
vitalif:csi-staging
vitalif:hotfix-1.1.0
vitalif:hotfix-1.0.0
vitalif:fsync-feedback
vitalif:cached-reads
vitalif:qemu-send-loop
vitalif:test-double-alloc
vitalif:hier-failure-domains
vitalif:mon-self-restart
vitalif:epoch-deletions
vitalif:rdma-flow-control
vitalif:csi-use-vitastor-cli
vitalif:rdma-v2
vitalif:etcd-hide-base64
vitalif:lrc-matrix
vitalif:rm-left-on-dead
vitalif:nfs-proxy-old
vitalif:non-odp-rdma
vitalif:test-zctr
vitalif:separate-data-connections
vitalif:sec_osd_msgr
vitalif:test-assert
vitalif:nbd-vmsplice
vitalif:allow-etcd-address-option
vitalif:rdma-zerocopy
vitalif:rel-0.5
vitalif:openonload
vitalif:sync-io-test
vitalif:trace-sync
vitalif:trace-sqes
vitalif:test-submit-and-wait
vitalif:test-sq-poll
vitalif:blocking-uring-test
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "koolkhel/vitastor:fio-out-of-fds"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
A fio job whose client runs out of file descriptors retries its OSD connections forever (
on_connect_peer()re-arms thepeer_connect_intervaltimer on EMFILE), so its I/O never completes and fio hangs with no error. Every fio job has its own client, which keeps one socket per OSD it has sent I/O to, so a large image on a cluster with more than about 1000 OSDs is enough at the usual soft limit of 1024.When ops are in flight, nothing has completed for 30 s, and the process cannot open even /dev/null (EMFILE/ENFILE), the engine now fails the job with EMFILE. It also prints one line with the soft and hard limits and the remedy:
The same check covers the image lookup in
sec_setup(): withcreate_serialize=0it runs in each job after the start, so one job can use up the process's fds while another is still waiting for etcd. Ops thatsec_queue()completes by itself (mirror error, read-only image) no longer stay in the in-flight count.Only the fio engine changes; the client library still retries forever, as QEMU and the other users expect. A stall with free fds (an inactive PG, a dead OSD) keeps waiting as before, and normal runs never meet the check. There is no new option.
Neighbour PR: #202 adds a failed-client check to the same two loops in
sec_getevents(). They are independent; if both are merged, both checks stay.Found: seen in a run (hang): fio stopped making progress on a cluster of about 3800 OSDs at the default soft limit of 1024 open files. Fd exhaustion is the likely cause there, not proven. Reproduced on a 3-OSD test cluster with the soft limit lowered.
Tested: in a downstream tree whose fio engine and connect retry are the same as on master (the run above is from there): 3 OSDs, a 3/2 pool with 16 PGs. Under the lowest soft limit at which fio writes one 128K stripe, a 2 MiB write (all 16 PGs) hung until killed at 120 s without the change. With it, the job fails after 30 s with EMFILE and the message above (fio exit code 1). The same write with
ulimit -n 1024is unaffected. The second commit was re-run there as well (both units pass); the lookup path has no test of its own. This patch on master: compiled only.Contributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.