-
Notifications
You must be signed in to change notification settings - Fork 1k
Reduce Wrangler disk IO #10909
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
base: main
Are you sure you want to change the base?
Reduce Wrangler disk IO #10909
Conversation
🦋 Changeset detectedLatest commit: 7b3bb78 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
These changes have been automatically backported to Wrangler v3 🎉 You can view the automatically updated PR at v3-maintenance...v3-backport-10909. Please check that PR for correctness, and make sure it's merged after this one. Thank you for helping us keep Wrangler v3 supported! |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
I believe the original reasoning behind this behaviour was to capture logs preemptively before the error occurs, even if you are not planning on dumping all the logs to the console. Then when you hit a bug (which could be transient) you have the logs available to diagnose the cause. With this change, that benefit is lost. Also, the change to only store logs if the output is set to debug seems a bit redundant. If you are already dumping the logs to the output there is little point in additionally writing them to disk, right? How about we have a rolling log that only stores the last X lines of debug output? This would keep the log file size down while still providing this diagnostic element. |
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.
I find having logs when an unexpected error occurs fairly useful. Can we delete logs on a successful run maybe?
Edit: didn't see what pete said, but +1 to cleaning up old logs.
Fixes #10523 and fixes #5460
The linked issues raise a valid point that Wrangler by default does a lot of disk IO and leaves large log files sitting around on your system. One of the issues proposed a new option to turn off writing logs to disk, but I think we can actually go a bit further. This PR entirely disables writing logs to disk unless one of the following conditions are met:
debug
My rationale is that log file support is primarily a debugging feature for the Wrangler team, and we only ask for log files with
WRANGLER_LOG=debug
turned on.WRANGLER_LOG_PATH
)