Commit b250d338 authored by Rob Latham's avatar Rob Latham
Browse files

deal with "infinitely stale" case



Dave Goodell reported a situation where ROMIO would retry "forever" and
suggested we give up after a large number of retries.
Signed-off-by: default avatar"Dave Goodell (dgoodell)" <dgoodell@cisco.com>
parent 6395fbae
...@@ -262,12 +262,17 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro ...@@ -262,12 +262,17 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
#endif #endif
static char myname[] = "ADIO_RESOLVEFILETYPE_FNCALL"; static char myname[] = "ADIO_RESOLVEFILETYPE_FNCALL";
/* NFS can get stuck and end up returing ESTALE "forever" */
#define MAX_ESTALE_RETRY 10000
int retry_cnt;
*error_code = MPI_SUCCESS; *error_code = MPI_SUCCESS;
#ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE #ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE
retry_cnt=0;
do { do {
err = statvfs(filename, &vfsbuf); err = statvfs(filename, &vfsbuf);
} while (err && (errno == ESTALE)); } while (err && (errno == ESTALE) && retry_cnt++ < MAX_ESTALE_RETRY);
if (err) { if (err) {
/* ENOENT may be returned in two cases: /* ENOENT may be returned in two cases:
...@@ -322,9 +327,10 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro ...@@ -322,9 +327,10 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
#endif /* STATVFS APPROACH */ #endif /* STATVFS APPROACH */
#ifdef HAVE_STRUCT_STATFS #ifdef HAVE_STRUCT_STATFS
retry_cnt = 0;
do { do {
err = statfs(filename, &fsbuf); err = statfs(filename, &fsbuf);
} while (err && (errno == ESTALE)); } while (err && (errno == ESTALE) && retry_cnt++ < MAX_ESTALE_RETRY);
if (err) { if (err) {
if(errno == ENOENT) { if(errno == ENOENT) {
...@@ -451,9 +457,10 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro ...@@ -451,9 +457,10 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
#endif /* STATFS APPROACH */ #endif /* STATFS APPROACH */
#ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE #ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE
retry_cnt = 0;
do { do {
err = stat(filename, &sbuf); err = stat(filename, &sbuf);
} while (err && (errno == ESTALE)); } while (err && (errno == ESTALE) && retry_cnt++ < MAX_ESTALE_RETRY);
if (err) { if (err) {
if(errno == ENOENT) { if(errno == ENOENT) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment