cloudflare / cloudflare/workerd
🐛 Bug Report — Noisy logging on client resets to DiskDirectory services
- Dominant language
- C++
- Stars
- 8.7k
- Forks
- 739
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 174
Description
With this script to trigger an immediate client connection reset pointed at a running workerd DiskDirectory service: (Technically in my setup we have a workerd service fronting that DiskDirectory to do content negotiation, but I don't _think_ that matters here?)
```
const net = require('net');
const socket = new net.Socket();
socket.connect(8080, "127.0.0.1", () => {
socket.write(
'GET / HTTP/1.1\n' +
'Host: localhost\n\n'
);
setTimeout(() => socket.resetAndDestroy(), 0);
});
```
We end up with the following logs on each run:
```
workerd/server/server.c++:3360: error: Uncaught exception: kj/async-io-unix.c++:290: disconnected: worker_do_not_log; Request failed due to internal error
stack: workerd@4005d83 workerd@568c67c workerd@2f8370c workerd@2fa137f workerd@2f8cb74 workerd@3ff6d8c workerd@2f8370c workerd@362248c workerd@34a135c workerd@2fa5b3f workerd@4007cfb workerd@4008d47 workerd@40096d3 workerd@3fd5470
```
Symbolized:
```
kj::(anonymous namespace)::HttpFixedLengthEntityWriter::pumpFrom(kj::AsyncInputStream&, unsigned long) (.resume)
http.c++:0:0
kj::(anonymous namespace)::AsyncPipe::BlockedPumpFrom::pumpTo(kj::AsyncOutputStream&, unsigned long)::'lambda'(unsigned long)::operator()(unsigned long) const
async-io.c++:0:0
kj::Promise::ignoreResult()::'lambda'(unsigned long&&)::operator()(unsigned long&&) const
server.c++:0:0
workerd::server::Server::DiskDirectoryService::request(kj::HttpMethod, kj::StringPtr, kj::HttpHeaders const&, kj::AsyncInputStream&, kj::HttpService::Response&) (.resume)
server.c++:0:0
kj::_::IdentityFunc::operator()() const
server.c++:0:0
kj::Promise kj::(anonymous namespace)::HttpClientAdapter::DelayedEofInputStream::wrap(unsigned long, kj::Promise)::'lambda'(kj::Exception&&)::operator()(kj::Exception&&) const::'lambda'()::operator()()
http.c++:0:0
kj::Promise::ignoreResult()::'lambda'(unsigned long&&)::operator()(unsigned long&&) const
server.c++:0:0
workerd::api::ServiceWorkerGlobalScope::request(kj::HttpMethod, kj::StringPtr, kj::HttpHeaders const&, kj::AsyncInputStream&, kj::HttpService::Response&, kj::Maybe, workerd::Worker::Lock&, kj::Maybe)::$_9::operator()(workerd::api::DeferredProxy)::'lambda'()::operator()()
global-scope.c++:0:0
workerd::(anonymous namespace)::WorkerEntrypoint::request(kj::HttpMethod, kj::StringPtr, kj::HttpHeaders const&, kj::AsyncInputStream&, kj::HttpService::Response&)::$_5::operator()(kj::Exception&&)
worker-entrypoint.c++:0:0
workerd::server::Server::HttpListener::Connection::request(kj::HttpMethod, kj::StringPtr, kj::HttpHeaders const&, kj::AsyncInputStream&, kj::HttpService::Response&) (.resume)
server.c++:0:0
kj::HttpServer::Connection::onRequest(kj::HttpHeaders::Request&) (.resume)
http.c++:0:0
kj::HttpServer::Connection::onHeaders(kj::OneOf&&) (.resume)
http.c++:0:0
kj::HttpServer::Connection::loop() (.resume)
http.c++:0:0
kj::HttpServer::Connection::startLoopImpl()::'lambda'(kj::Exception&&)::operator()(kj::Exception&&) const
http.c++:0:0
```
This is particularly noisy/noticeable for me in the case when doing local development using the DiskDirectory service to serve locally-build JS/CSS assets—for which browsers will race the cache and drop unnecessary pending requests on cache hit.
Contributor guide
Assessment
This issue has not been assessed yet.