Event loops: the callbacks' relay given back to sockmap() on a reload

sockmap() has a connection go by the newest configuration's rules after
a reload (reattachfunc), which may end it. The relay of the callbacks
did not, and a connection the new rules refuse went on. Once the
configuration is newer than the connection, it is given back to
sockmap() as it is, which does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vladimir Dubrovin 2026-10-25 19:59:44 +03:00
parent 23e83a6b02
commit 82387caf2f

View File

@ -410,6 +410,9 @@ static int cbmaprun(struct cbmap *m){
int round, moved = 0; int round, moved = 0;
ssize_t n; ssize_t n;
/* a reload: sockmap() takes the connection back, which has it go by
the newest configuration's rules, or ends it */
if(param->version < runconf->version) return cbmapend(m, -2);
for(round = 0; round < CBROUNDS; round++){ for(round = 0; round < CBROUNDS; round++){
int progress = 0, end = !m->halfclose && (m->cterm_r || m->sterm_r); int progress = 0, end = !m->halfclose && (m->cterm_r || m->sterm_r);
@ -532,7 +535,8 @@ static void cbmapidle(struct loop *l, struct looptimer *t){
} }
/* sockmapcbfunc: sockmap() of a fiber, as callbacks, its result; -2 for /* sockmapcbfunc: sockmap() of a fiber, as callbacks, its result; -2 for
sockmap() to map it itself. */ sockmap() to map it itself, from the start or from where the callbacks
left it after a reload. */
static int fibermap(struct clientparam *param, int timeo){ static int fibermap(struct clientparam *param, int timeo){
struct looper *lp = curlooper; struct looper *lp = curlooper;
struct cbmap m; struct cbmap m;