[sheepdog] [PATCH RFC 0/5] sockfd shrinking mechanism for handling EMFILE

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Fri Jul 12 03:54:21 CEST 2013


This patchset implements a mechanism for shrinking cached fds in
sockfd subsystem for handling EMFILE gracefully. With this mechanism,
sheep can retry creating a new fd after it faces EMFILE. In this
patchset, some invocations of retrying are inserted into various
operations which can create new fds.

Clearly, there is a big room for discussion. We can implement a
smarter algorithm for shrinking and there would be a better policy for
retrying. I'd like to hear your comments.

Hitoshi Mitake (5):
  sheep: add nid_to_str() for formatting node id from sockfd subsystem
  sockfd: implement shrinking mechanism for handling EMFILE
  tests/dynamorio: add a new DR based tester for EMFILE handling
  sheep: replace open() with retry_open()
  sheep: retry when connect() or accept() fails with EMFILE

 include/sheep.h                       |   11 ++--
 sheep/md.c                            |    2 +-
 sheep/object_cache.c                  |    8 +--
 sheep/plain_store.c                   |    6 +--
 sheep/request.c                       |    7 +++
 sheep/sheep_priv.h                    |    2 +
 sheep/sockfd_cache.c                  |   90 +++++++++++++++++++++++++++++++++
 sheep/store.c                         |    2 +-
 tests/dynamorio/emfile/01.sh          |   24 +++++++++
 tests/dynamorio/emfile/CMakeLists.txt |    9 ++++
 tests/dynamorio/emfile/emfile.c       |   46 +++++++++++++++++
 11 files changed, 195 insertions(+), 12 deletions(-)
 create mode 100755 tests/dynamorio/emfile/01.sh
 create mode 100644 tests/dynamorio/emfile/CMakeLists.txt
 create mode 100644 tests/dynamorio/emfile/emfile.c

-- 
1.7.10.4




More information about the sheepdog mailing list