FileUploadResource does not release lock on validation errors

Created on 26 November 2020, over 3 years ago
Updated 25 September 2023, 9 months ago

Problem/Motivation

FileUploadResource uses a lock to prevent duplicate file name uploads. The lock is never released when an exception is thrown during file validation.

Steps to reproduce

1) Send a file that fails validation, for example because of file size.
2) Send the same file name with correct file size.
3) You get a 503 locked exception although the upload should work.

Proposed resolution

Always release the lock with a finally {} block in FileUploadResource. The same thing was done in GraphQL module in https://github.com/drupal-graphql/graphql/pull/1118

Remaining tasks

2) How could we test this?

πŸ› Bug report
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component
File moduleΒ  β†’

Last updated 3 days ago

Created by

πŸ‡¦πŸ‡ΉAustria klausi πŸ‡¦πŸ‡Ή Vienna

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024