mcl-rag#27: every HTTP handler returns {ok, Req, State} from init/2 #29
Loading…
Reference in a new issue
No description provided.
Delete branch "saturnus/27-handlers-return-ok"
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?
Purpose (fix): every HTTP request ends cleanly. The request process no longer crashes after its reply, and the connection closes when the request asks it to.
Refs #27
15 of the 17 handlers returned the reply
Reqalone frominit/2. Each now returns{ok, Req, State}: the same three-line change everywhere, with_Staterenamed toStatein 4. search_chunks_semantic and seed_corpus already did this.New suite
mcl_rag_http_handlers_end_SUITE, one case per handler (17). Each case sends its route two requests withconnection: close:It asserts the handler's own status, that the server closes the socket, and that nothing is logged at error level.
Red first: the suite is committed alone (
fec5619). On0397a80it is red for exactly the 15 handlers, on the socket that never closes; the 2 handlers that already returned{ok, Req, State}are green.Local runs: the new suite passes 17 of 17,
rebar3 ctpasses 97, and eunit, dialyzer and lint are green. The CHANGELOG entry is under Unreleased (0.11.2, with #26).