Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic expecting "response receiver is open" #353

Open
jameysharp opened this issue Mar 28, 2024 · 1 comment
Open

panic expecting "response receiver is open" #353

jameysharp opened this issue Mar 28, 2024 · 1 comment

Comments

@jameysharp
Copy link
Contributor

jameysharp commented Mar 28, 2024

I'm sometimes seeing this panic kill a thread that's handling an incoming HTTP request:

thread 'tokio-runtime-worker' panicked at lib/src/session/downstream.rs:52:54:
response receiver is open: ()

Viceroy continues running afterward and responding to further requests.

The panic in question is from expect in this function:

// Mark this `DownstreamResponse` as having been sent, and match on the previous value.
match mem::replace(self, Sent) {
Closed => panic!("downstream response channel was closed"),
Pending(sender) => sender
.send(response)
.map_err(|_| ())
.expect("response receiver is open"),
Sent => return Err(Error::DownstreamRespSending),
}

I think this means that the guest service called send multiple times, but it's not clear to me how my service could have done that. If it is due to a bug in my guest code, it would be nice to get a better error message. I tried upgrading my service from fastly crate version 0.9.4 to 0.9.11 in case that mattered, but I saw this panic at both versions.

@jameysharp
Copy link
Contributor Author

Oh, it looks like this panic is only happening when my browser requests /favicon.ico from my service. My service doesn't look at the path at all and always returns a text/plain response. I'm wondering if the browser sees that, closes the connection early, and then Viceroy gets confused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant