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

core(network-recorder): handle QUIC requests #5256

Merged
merged 3 commits into from
May 19, 2018
Merged

core(network-recorder): handle QUIC requests #5256

merged 3 commits into from
May 19, 2018

Conversation

patrickhulce
Copy link
Collaborator

closes #5254

@@ -107,9 +107,15 @@ class NetworkRecorder extends EventEmitter {
return;
}

// QUIC network requests don't always "finish" even when they're done loading data
// Use receivedHeaders instead, see https://github.com/GoogleChrome/lighthouse/issues/5254
const isQUIC = record._responseHeaders && record._responseHeaders
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice pulled out into a function to separate determining if request is QUIC vs what to do with QUIC requests

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could also be a function that's like isQuicAndFinished(record) to absorb logic below, too :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

// QUIC network requests don't always "finish" even when they're done loading data
// Use receivedHeaders instead, see https://github.com/GoogleChrome/lighthouse/issues/5254
const isQUIC = record._responseHeaders && record._responseHeaders
.find(header => header.name.toLowerCase() === 'alt-svc' && /quic/.test(header.value));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how certain is the 'alt-svc' check? Any other way to tell?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be fairly certain, in the spec it's not technically required to announce it buuuuuut...

While HTTP/QUIC doesn't formally require a client to implement Alt-Svc, there's no discovery mechanism other than Alt-Svc provided, so you're not going to get very far without
it.

from quicwg/base-drafts#253

@@ -119,7 +125,7 @@ class NetworkRecorder extends EventEmitter {
.sort((a, b) => a.time - b.time);

let numInflightRequests = 0;
let quietPeriodStart = 0;
let quietPeriodStart = -Infinity;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the advantage of a [-Infinity, 0] period? Time starting at 0 also seems like a reasonable state of things

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fine just made tests have [0, 0] quiet period so we either handle the empty period case, move test cases to past 0, or -Infinity, -Infinity seemed like most reasonable conceptually but I do not have strong feelings

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it may be fine, and I haven't spent enough time here recently to have a good gut instinct, but I think I would expect the earliest quiet period to start at 0.

I guess I don't understand what this is addressing. Seems independent of the QUIC change?

@brendankenny
Copy link
Member

brendankenny commented May 18, 2018

is this something we should also fix in the upstream NetworkManager so these are marked as finished? Or is it actually fixed and we just haven't updated our devtools frontend in so long...

@patrickhulce
Copy link
Collaborator Author

is this something we should also fix in the upstream NetworkManager so these are marked as finished? Or is it actually fixed and we just haven't updated our devtools frontend in so long...

DevTools frontend handles this case correctly, I didn't dive into the code there to see how since its ~2 years or so diff :)

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

Successfully merging this pull request may close these issues.

H2/QUIC requests don't fire RequestFinished
3 participants