Description
Reproduction steps:
- Sign into a deployment
- Turn on Coder Connect and wait for it to start
- Turn off Coder Connect
- Sign out
- Sign into a different deployment (different URL)
- Turn on Coder Connect
Coder Connect spinner will spin indefinitely and never come up.
We've traced it to Downloader.cs
which maintains a ConcurrentDictionary called _downloads
, which tracks in-progress download tasks keyed off destination path. We don't ever clear tasks out of this dictionary when they complete, so a new download, for a different URL gets stuck in a loop looking up the task in the dictionary, waiting for it (which returns instantly because it's done), and then noticing it's for a different URL, and retrying in a loop.