release semaphore in case of exception in accept

This commit is contained in:
craff 2021-12-11 23:21:47 -10:00
parent b468854626
commit a130c4ea35

View file

@ -1104,6 +1104,7 @@ let run (self:t) : (unit,_) result =
raise e
);
with e ->
Sem_.release 1 self.sem_max_connections;
_debug (fun k -> k
"Unix.accept or Thread.create raised an exception: %s"
(Printexc.to_string e))