-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(Turborepo): Make package discovery async, and apply a debouncer #8058
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Ignored Deployments
|
🟢 Turbopack Benchmark CI successful 🟢Thanks |
🟢 CI successful 🟢Thanks |
Could this solve the issue I am experiencing?
pnpm exec turbo watch build --filter={packages/\*}
• Packages in scope: <snip>
• Running build in 36 packages
• Remote caching enabled
× failed to connect to daemon
╰─▶ server is unavailable: channel closed pnpm exec turbo daemon status
✓ daemon is running
log file: /Users/xxx/Development/Projects/monorepo/.turbo/daemon/f5b0831ce8ff9a15-turbo.log.2024-04-29
uptime: 2h 8m 22s 976mss
pid file: /var/folders/1m/4921_csd7gnddqdr0smhfqjh0000gn/T/turbod/f5b0831ce8ff9a15/turbod.pid
socket file: /var/folders/1m/4921_csd7gnddqdr0smhfqjh0000gn/T/turbod/f5b0831ce8ff9a15/turbod.sock |
Possibly. If you're seeing errors in the daemon log from the package
watcher, then there's a good chance.
…On Mon, Apr 29, 2024, 3:45 PM Weyert de Boer ***@***.***> wrote:
Could this solve the issue I am experiencing?
2024-04-29T22:41:44.167258Z ERROR turborepo_lib::daemon::server: package changes stream closed: channel closed
pnpm exec turbo watch build --filter={packages/\*}
• Packages in scope: <snip>
• Running build in 36 packages
• Remote caching enabled
× failed to connect to daemon
╰─▶ server is unavailable: channel closed
—
Reply to this email directly, view it on GitHub
<#8058 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADGD7NHCYZHVKOMYSZMRJDY73ERVAVCNFSM6AAAAABG7CATXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBTHAYTGMZUGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few style items and a quick Q
}; | ||
let initial_discovery = match discovery.discover_packages().await { | ||
Ok(discovery) => discovery, | ||
// If we failed the discovery, that's fine, we've reset the values, leave them as None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets just get rid of the references to None here since they aren't relevant now that we've pulled out the fn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, done.
} | ||
} | ||
tracing::trace!("package watcher state: {:?}", state); | ||
} | ||
} | ||
|
||
fn handle_discovery_result(&self, package_result: DiscoveryResult, state: &mut State) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should the behaviour be if we get a DiscoveryResult
with valid State
? Should our state perhaps also store a version and be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We won't ever get an update with a higher version. Each time we allocate a discovery request, we set the state to pending, with that version, and don't set it back to ready until get a matching version. That means if we're setting it to ready, there are no higher-versioned requests outstanding.
Co-authored-by: Alexander Lyon <arlyon@me.com>
Would it be possible to create a canary build that will include this PR when its merged? Love to try this change |
Description
Testing Instructions
Existing test suite.
Fixes #3455
Closes TURBO-2909