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

feat(ext/cache): support lscache #27628

Merged
merged 28 commits into from
Jan 28, 2025
Merged

Conversation

bartlomieju
Copy link
Member

No description provided.

bartlomieju and others added 9 commits January 17, 2025 14:29
The TLS start sequence has been broken since denoland#26661 because of the way
how we wrap TCP handle to create TLS handle.

denoland#26661 introduced happy-eyeballs algorithm and some connection could be
dropped because of happy-eyeball attempt timeout. The current
implementation doesn't consider that case and it could start TLS
handshake with timed out TCP connection. That caused denoland#27652 .

This PR fixes it by changing the initialization steps. Now `wrapHandle`
of TLSSocket set up `afterConnectTls` callback in TCP handle, and
`afterConnect` of TCP handle calls it at `connect` event timing if it
exists. This avoids starting TLS session with timed out connection.

closes denoland#27652
This slightly degrades the performance of CJS export analysis on
subsequent runs because I changed it to no longer cache in the DENO_DIR
with this PR (denort now properly has no idea about the DENO_DIR). We'll
have to change it to embed this data in the binary and that will also
allow us to get rid of swc in denort (will do that in a follow-up PR).
Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

I think enablement should happen through a DENO_CACHE_LSC_ENDPOINT env var and no flag. The env var should be structured as <endpoint>,<token>. This would allow removing LSC_ENDPOINT and LSC_TOKEN.

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

LGTM - we should change this to be slightly more generic (DENO_CACHE_HTTP_ENDPOINT and DENO_CACHE_HTTP_TOKEN, and not using x-lsc- headers) down the line. Then we can also document this.

@bartlomieju bartlomieju enabled auto-merge (squash) January 28, 2025 18:19
@bartlomieju bartlomieju merged commit a5a1cce into denoland:main Jan 28, 2025
17 checks passed
@bartlomieju bartlomieju deleted the lsc_cache branch January 28, 2025 19:09
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.

5 participants