various fix

working version

TODO:
- Add some tests
- Update the number of retry acocording to the retry limit
- Allow to have a configuration file with pdisk_size equal 0