[Issue #203] error out if FIO_FDMAX is exceeded in fio_open

This commit is contained in:
Grigory Smolkin
2020-05-14 12:41:11 +03:00
parent b33f93c3d9
commit 200e47b394
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -352,6 +352,9 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync)
dir_list_file(backup_files_list, parray_get(external_dirs, i),
false, true, false, i+1, FIO_DB_HOST);
/* close ssh session in main thread */
fio_disconnect();
/* Sanity check for backup_files_list, thank you, Windows:
* https://github.com/postgrespro/pg_probackup/issues/48
*/
@@ -526,9 +529,6 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync)
arg->ret = 1;
}
/* close ssh session in main thread */
fio_disconnect();
/* Run threads */
thread_interrupted = false;
elog(INFO, "Start transferring data files");
+3 -3
View File
@@ -348,9 +348,9 @@ int fio_open(char const* path, int mode, fio_location location)
mask = fio_fdset;
for (i = 0; (mask & 1) != 0; i++, mask >>= 1);
if (i == FIO_FDMAX) {
return -1;
}
if (i == FIO_FDMAX)
elog(ERROR, "FIO_FDMAX is exceeded, probably too many remote files has been opened");
hdr.cop = FIO_OPEN;
hdr.handle = i;
hdr.size = strlen(path) + 1;