-
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
Revert "Manage transaction rollback" #2545
Conversation
This commit attempts to fix leftover files in failed transactions, but in the process introduces three problems: - Uploader state is inconsistent between `save` and `commit`. For example, reading `my_object.file_url.url` will return a bogus url if I read before commit. - A file might not be uploaded after a successful commit. For example, if there is a network failure. This causes the transaction to not be rolled back and invalid records being recorded. - Even if the upload eventually completes, it can take an arbitrary amount of time, during which the record is invalid. This reverts commit 665f225. Fixes: carrierwaveuploader#2544
Just reverting will bring the original issue back again, what we need will be:
|
Agreed. But given the choice between stale files and missing files, I'd prefer the first (thus the "naked" revert).
I've been poking at this but a new codebase always takes time. |
Hi I added a second commit adding the |
0406089
to
88e3717
Compare
Scratch that. It fails for rails < 6, I'm investigating. |
I added the followup changes on a separate PR, so that this can be merged and restoring the other functionality is worked apart. |
I don't see any benefit in merging this separately, let's close this and discuss further in #2546. |
There are other reasons to keep the call to |
This commit attempts to fix leftover files in failed transactions, but
in the process introduces three problems:
save
andcommit
. For example, readingmy_object.file_url.url
will return a bogus url if read before commit.This reverts commit 665f225 from #2209.
Fixes: #2544