Closed Bug 970279 Opened 10 years ago Closed 10 years ago

null http transactions cannot be canceled and have long timeout

Categories

(Core :: Networking: HTTP, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: mcmanus, Assigned: mcmanus)

References

Details

Attachments

(1 file)

I loaded an https:// page which did a 3whs but did not respond to the TLS client hello. I hit escape (or reload - tried them both) and the UI looked like it retried, but the tcpdump didn't show any new activity.

That was because a Null transaction was at the front of the queue - and it isn't hooked up to the docshell loadgroup so it didn't receive the cancel. It also didn't hit the normal HTTP timeout logic where we demand at least one response byte back in the first 30 seconds or so (I'd have to lookup what the actual value is).

Null transactions are just optimizations, so if they aren't working out we should feel free to toss them away. Maybe the next try will work better - it couldn't work much worse.

So this patch does two things

1] enables the http response timer for the transaciton.. normal transactions disable this timer when they start receving data, but a null transaction is really just hanging around to negotiate TLS - so it stays enabled for the duration - timing out at 15 seconds.

2] I don't think its a good idea to put these into a docshell loadgroup (and with some very speculative ones its impossible) - so instead when an origin receives a cancel, if the front of the queue is occupied by a null trasnaction then cancel the null transaction too. That's a little harsh, but as a heuristic I think it does the right thing. (and the null should never be required).

this removes one situation where we can appear to just be unable to connect to an origin for an extended period of time. (assuming the null transaction's difficulties are ephemeral).
Assignee: nobody → mcmanus
Status: NEW → ASSIGNED
Attachment #8373308 - Flags: review?(hurley) → review?(hurley)
Comment on attachment 8373308 [details] [diff] [review]
tie null transactions to cancel and timeout events

Review of attachment 8373308 [details] [diff] [review]:
-----------------------------------------------------------------

::: netwerk/protocol/http/NullHttpTransaction.h
@@ +40,5 @@
> +  PRIntervalTime ResponseTimeout() MOZ_OVERRIDE MOZ_FINAL
> +  {
> +    return PR_SecondsToInterval(5);
> +  }
> +  

nit: whitespace
Attachment #8373308 - Flags: review?(hurley) → review+
comment 0 said a 15 second timeout and comment 3 indicates a 5 second timeout. I changed that to be 15 consistently.

remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/4472e5b98cc6
https://hg.mozilla.org/mozilla-central/rev/4472e5b98cc6
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Blocks: 971893
No longer blocks: 971893
Depends on: 971893
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: