Merge pull request #22853 from taosdata/fix/TD-26139/fileHandlesLimitOnWindows
reset file handles limit on windows
This commit is contained in:
commit
b2e9578de9
|
@ -112,6 +112,8 @@ int32_t taosGetErrorFile(TdFilePtr pFile);
|
||||||
|
|
||||||
int32_t taosCompressFile(char *srcFileName, char *destFileName);
|
int32_t taosCompressFile(char *srcFileName, char *destFileName);
|
||||||
|
|
||||||
|
int32_t taosSetFileHandlesLimit();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1601,6 +1601,7 @@ int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile
|
||||||
if (taosSetS3Cfg(tsCfg) != 0) return -1;
|
if (taosSetS3Cfg(tsCfg) != 0) return -1;
|
||||||
}
|
}
|
||||||
taosSetSystemCfg(tsCfg);
|
taosSetSystemCfg(tsCfg);
|
||||||
|
if (taosSetFileHandlesLimit() != 0) return -1;
|
||||||
|
|
||||||
cfgDumpCfg(tsCfg, tsc, false);
|
cfgDumpCfg(tsCfg, tsc, false);
|
||||||
|
|
||||||
|
|
|
@ -960,3 +960,12 @@ cmp_end:
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t taosSetFileHandlesLimit() {
|
||||||
|
#ifdef WINDOWS
|
||||||
|
const int max_handles = 8192;
|
||||||
|
int res = _setmaxstdio(max_handles);
|
||||||
|
return res == max_handles ? 0 : -1;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue