Open domenkozar opened 6 years ago
Way to reproduce:
[root@staging:~]# git clone https://github.com/input-output-hk/iohk-ops
[root@staging:~]# cd iohk-ops/
[root@staging:~]# git checkout slow-fallocate
[root@staging:~]# cd slow-fallocate
[root@staging:~]# nix-build
# confirm fallocate is slower
[root@staging:~]# time LD_PRELOAD=./result/lib/libslow-fallocate.so fallocate img.bin -l 1g
# confirm the current cardano args
[root@staging:~]# ps aux | grep cardano
[root@staging:~]# systemctl stop cardano-node
[root@staging:~]# sudo -u cardano-node /bin/sh
# run cardano with the normal args, and the LD_PRELOAD set
LD_PRELOAD=/nix/store/i064x9kmiy9b143li7i4621cbsqdd351-slow-fallocate/lib/libslow-fallocate.so /nix/store/wn9vva936qpbwp46rs0bv0jrpd1iq97z-cardano-sl-0.6.2/bin/cardano-node-simple .....
# ctrl+c to stop after a while
[node:DEBUG] [2017-09-25 15:43:02 UTC] waiting for [] outbound inbound
[node:ERROR] [2017-09-25 15:43:02 UTC] exception while stopping node thread killed
[node:ERROR] [2017-09-25 15:43:02 UTC] exception while stopping node thread killed
fallocate(22, 1, 0, 73819750) == 0
fallocate(22, 3, 3809, 73815941) == 0
fallocate(16, 3, 137, 4613597) == 0
fallocate(15, 3, 548, 4193756) == 0
Segmentation fault (core dumped)
[root@staging:~]# systemctl start cardano-node
Proposed API change: https://gist.github.com/cleverca22/77582806a7eb8c5bb34655af16268295
If one thread closes DB and another one tries to access it, you get a segfault: