deno/ext/http
Matt Mastracci 68a0877f8d
fix(ext/http): avoid lockup in graceful shutdown (#21253)
Follow-up to #20822. cc @lrowe 

The `httpServerExplicitResourceManagement` tests were randomly failing
on CI because of a race.

The `drain` waker was missing wakeup events if the listeners shut down
after the last HTTP response finished. If we lost the race (rare), the
server Rc would be dropped and we wouldn't poll it again.

This replaces the drain waker system with a signalling Rc that always
resolves when the refcount is about to become 1.

Fix verified by running serve tests in a loop:

```
for i in {0..100}; do cargo run --features=__http_tracing -- test
 -A --unstable '/Users/matt/Documents/github/deno/deno/cli/tests/unit/ser
ve_test.ts' --filter httpServerExplicitResourceManagement; done;
```
2023-11-23 16:39:17 +00:00
..
benches chore: use rustfmt imports_granularity option (#17421) 2023-01-14 23:18:58 -05:00
00_serve.js refactor(ext/http): Use HttpRecord as response body to track until body completion (#20822) 2023-11-13 19:17:31 +00:00
01_http.js feat: disposable Deno resources (#20845) 2023-11-01 20:26:12 +01:00
Cargo.toml chore(ext/http): bump version for re-release (#21254) 2023-11-18 15:13:17 -07:00
compressible.rs chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
http_next.rs fix(ext/http): avoid lockup in graceful shutdown (#21253) 2023-11-23 16:39:17 +00:00
hyper_util_tokioio.rs feat(ext/http): Upgrade to hyper1.0-rc4 (#19987) 2023-07-31 07:34:53 -06:00
lib.rs refactor(ext/http): Use HttpRecord as response body to track until body completion (#20822) 2023-11-13 19:17:31 +00:00
network_buffered_stream.rs chore: fix typos (#19572) 2023-06-26 09:10:27 -04:00
reader_stream.rs chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
README.md chore: add README to ext/http/ (#11958) 2021-09-08 20:48:28 +02:00
request_body.rs fix(ext/http): ensure aborted bodies throw (#20503) 2023-09-15 08:08:21 -06:00
request_properties.rs refactor(ext/http): generic abstract listeners (#19132) 2023-05-15 16:55:47 +02:00
response_body.rs refactor(ext/http): Use HttpRecord as response body to track until body completion (#20822) 2023-11-13 19:17:31 +00:00
service.rs fix(ext/http): avoid lockup in graceful shutdown (#21253) 2023-11-23 16:39:17 +00:00
websocket_upgrade.rs chore: update to Rust 1.71 (#19822) 2023-07-13 15:16:24 -06:00

deno_http

This crate implements server-side HTTP based on primitives from the Fetch API.