samuong / alpaca

A local HTTP proxy for command-line tools. Supports PAC scripts and NTLM authentication.
Apache License 2.0
184 stars 31 forks source link

Connect timeout blocks all connections #54

Closed chrisgavinator closed 2 years ago

chrisgavinator commented 4 years ago

Seeing a few of these...

2020/06/10 15:46:48 proxy.go:146: [16301] Error reading CONNECT response: read tcp xx.xx.xx.xx:xxxx->xx.xx.xx.xx:xxxx: read: operation timed out

They appear to block all other connections through alpaca when they occur.

camh- commented 4 years ago

It is possible that if one connection to the proxy is timing out, the proxy is generally unresponsive. This would look like the other connections are blocked too. Does traffic immediately return after this point in the logs?

chrisgavinator commented 4 years ago

Would seem so. I especially notice it when on meeting conferencing - everything freezes up.

Traffic immediately returns afterwards... pause time subjectively seems pretty consistent so feels like a timeout threshold is being hit.

samuong commented 4 years ago

If, during this pause, you make a request that doesn't go through a proxy (e.g. you browse to your local intranet site), is that request affected? That would help us determine whether it's a problem with Alpaca, or the upstream proxy.

Also, roughly how long is the timeout for you? We don't actually set one in Alpaca when we call net.Dial() and according to the docs this means we'll fall back to some OS-level timeout.

samuong commented 2 years ago

Closing this as it appears to have been an issue with the upstream proxy, that has been fixed. Feel free to reopen if it starts to cause problems again.