webfs: faster shutdown using postnote()
when the 9p end is closed, post a note to our private note group to shoot down http procs. this results in quicker release of namespace resources.
This commit is contained in:
parent
302fc26fdd
commit
3d20565a78
2 changed files with 13 additions and 5 deletions
|
@ -756,6 +756,13 @@ fsstart(Srv*)
|
|||
unmount(nil, mtpt);
|
||||
}
|
||||
|
||||
static void
|
||||
fsend(Srv*)
|
||||
{
|
||||
postnote(PNGROUP, getpid(), "shutdown");
|
||||
exits(nil);
|
||||
}
|
||||
|
||||
Srv fs =
|
||||
{
|
||||
.start=fsstart,
|
||||
|
@ -768,6 +775,7 @@ Srv fs =
|
|||
.write=fswrite,
|
||||
.flush=fsflush,
|
||||
.destroyfid=fsdestroyfid,
|
||||
.end=fsend,
|
||||
};
|
||||
|
||||
void
|
||||
|
@ -832,5 +840,5 @@ main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
postmountsrv(&fs, service, mtpt, MREPL);
|
||||
exits(0);
|
||||
exits(nil);
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ hclose(Hconn *h)
|
|||
/* free the tail */
|
||||
hcloseall(x);
|
||||
} while(i);
|
||||
exits(0);
|
||||
exits(nil);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -492,7 +492,7 @@ Again:
|
|||
static void
|
||||
catch(void *, char *msg)
|
||||
{
|
||||
if(strstr("alarm", msg) || strstr("die", msg))
|
||||
if(strstr("alarm", msg) != nil)
|
||||
noted(NCONT);
|
||||
else
|
||||
noted(NDFLT);
|
||||
|
@ -710,7 +710,7 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost)
|
|||
}else
|
||||
h->keep = 0;
|
||||
if(pid == 0)
|
||||
exits(0);
|
||||
exits(nil);
|
||||
}
|
||||
/* no timeout when posting */
|
||||
alarm(0);
|
||||
|
@ -1000,5 +1000,5 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost)
|
|||
shdr = k->next;
|
||||
free(k);
|
||||
}
|
||||
exits(0);
|
||||
exits(nil);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue