fix(std/net/http): correct server lifecycle #1478
No reviewers
Labels
No labels
UX
active development
backlog
blocker
bootstrap
bounty
bug
dependencies
discussion
documentation
duplicate
enhancement
flaky test
help wanted
invalid
javascript
question
release
tendentious
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mighty-gerbils/gerbil!1478
Loading…
Reference in a new issue
No description provided.
Delete branch "jay/gerbil:bug-http-server-lifecycle"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
HTTP server shutdown can hang because listener
EBADFerrors are retried and condition-variable timeout results are ignored. Peer disconnects during server-owned response closing are also logged as unhandled handler failures.This PR makes
EBADFterminal, enforces the shutdown deadline, caches listener addresses before closure, and contains onlyEPIPE/ECONNRESETfrom response finalization.this looks good to me, only actionable is to log the error when we fail to start a listener.
also, if all listeners fail i think we should fail the start altogether.
@ -70,2 +70,4 @@(def (do-server-start! (self : http-server))=> :void(def (start-listener! (sock : ServerSocket))(with-error (ignore-errors (sock.close))i think that at the minimum report errors -- you can use
report-errorsalthough i think it is better to log the errors in the syslog instead of the console. so a try/catch and a syslog.error is in order.
@ -180,3 +184,1 @@error: (OSError-message e)errno: (OSError-errno e))(loop))(if (fx= (OSError-errno e) EBADF)any spurious other errors we might get?
also, let's make this a cond? slightly prettier.
WIP: fix(std/net/http): correct server lifecycleto fix(std/net/http): correct server lifecyclethank you!