Call aePostFunction to change the setsize of each threads by that thread

Former-commit-id: 7b1221a74d06616149436fd44d67a2ad83048e44
This commit is contained in:
Kajaruban Surendran 2020-11-23 21:58:54 +00:00 committed by John Sully
parent 04ad6b5078
commit e53d00c320

View File

@ -2278,10 +2278,12 @@ static int updateMaxclients(long long val, long long prev, const char **err) {
if ((unsigned int) aeGetSetSize(g_pserver->rgthreadvar[iel].el) <
g_pserver->maxclients + CONFIG_FDSET_INCR)
{
if (aeResizeSetSize(g_pserver->rgthreadvar[iel].el,
g_pserver->maxclients + CONFIG_FDSET_INCR) == AE_ERR)
{
*err = "The event loop API used by Redis is not able to handle the specified number of clients";
int res = aePostFunction(g_pserver->rgthreadvar[iel].el, [iel] {
aeResizeSetSize(g_pserver->rgthreadvar[iel].el, g_pserver->maxclients + CONFIG_FDSET_INCR);
});
if (res != AE_OK){
*err = "Failed to set the setsize for this thread.";
return 0;
}
}