-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(proxy-wasm) invoke 'on_http_call_response' on dispatch failures
Invoke `on_http_call_response` on dispatch connection failures. This allows catching failures such as: - timeout - broken connection - resolver failures - TLS handshake failures - Any other failures *after the connection has attempted to be established* Dispatch failures occurring *before* a connection has attempted to be established will not trigger `on_http_call_response` as they are already supposed to trigger a Wasm exception (i.e. trap). When a dispatch connection failure occurs, `on_http_call_response` is invoked with: `on_http_call_response(call_id, 0, 0, 0)` (i.e. no header, no body, no trailers). Calls to retrieve the response `:status` will return `None`. A user may triage the connection failure by querying the `:dispatch_status` pseudo-header: ```rust fn on_http_call_response( &mut self, token_id: u32, nheaders: usize, body_size: usize, ntrailers: usize, ) { let dispatch_status = self.get_http_call_response_header(":dispatch_status"); match dispatch_status.as_deref() { Some("timeout") => {}, Some("broken connection") => {}, Some("tls handshake failure") => {}, Some("resolver failure") => {}, Some("reader failure") => {}, Some(s) => info!("dispatch_status: {}", s), None => {} } self.resume_http_request() } ``` The socket status `"bad argument"` also exists but since the connection has not been attempted yet, it won't show up during `on_http_call_response` and is for internal use only (i.e. could be added to the socket error log for example). Fix #622.
- Loading branch information
1 parent
9238d4a
commit 6499d6d
Showing
14 changed files
with
536 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.