denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
96.54k stars 5.33k forks source link

`deno repl` hangs without network access #16426

Open mhio opened 1 year ago

mhio commented 1 year ago

Running the repl in 1.25.4 and 1.26.2 in a debian:11 container hangs when there's no network access.

There are connection attempts to deno.land / tcp / 443, that seem to do a retry backoff which takes a couple of minutes

$ date; docker run -ti me/deno /deno repl --eval 'console.log(new Date())'
Wed 26 Oct 2022 01:45:56 UTC

2022-10-26T01:48:07.230Z
Deno 1.25.4
exit using ctrl+d or close()
> 

I think it might be related to the connections being dropped rather than getting an ICMP response.

The --no-remote options don't seem to affect whatever is loading.

Could the remote lookups be disabled optionally? Is there a way to pre cache the remote lookup?

mhio commented 1 year ago

Is it the completions that are trying to load?

https://github.com/denoland/deno/blob/4d166e638f387db45d9ae1fe967db6a18ff7cc03/cli/lsp/repl.rs#L302-L306

bartlomieju commented 1 year ago

@dsherret should we add a timeout here and continue if completion setting can't be obtained?

crowlKats commented 5 days ago

I cannot reproduce this anymore; @mhio is this still happening?