View Issue Details

IDProjectCategoryView StatusLast Update
0004153Composrcorepublic2020-02-28 00:31
ReporterChris GrahamAssigned ToChris Graham 
Severitytrivial 
Status resolvedResolutionfixed 
Product Version10.0.30 
Fixed in Version10.0.31 
Summary0004153: Incorrect file write errors on race condition
DescriptionIf 1 web request is waiting on a lock in cms_file_put_contents_safe, it will write immediately on acquiring the lock - but the original locker will check the filesize of what it just wrote and see it as zero due to the new request in the process of writing.

This filesize check is unnecessary. We already check the number of bytes written is correct and have no reason to doubt the accuracy of it.
We could try and preserve a write lock by not using PHP's file_put_contents but rather fopen/fwrite and our own locking, to keep the lock open until filesize runs, but this is adding even more complexity to something that we can instead simplify.
TagsNo tags attached.
Attach Tags
Time estimation (hours)
Sponsorship open

Relationships

has duplicate 0004149 closedChris Graham Composr website (compo.sr) Tutorials: Recently up-voted error 

Activities

admin

2020-02-28 00:31

administrator   ~0006448

Fixed in git commit 0b15ee0ed (https://gitlab.com/composr-foundation/composr/commit/0b15ee0ed - link will become active once code pushed to GitLab)

A hotfix (a TAR of files to upload) has been uploaded to this issue. These files are made to the latest intra-version state (i.e. may roll in earlier fixes too if made to the same files) - so only upload files newer than what you have already. If there are files in a hot-fix that you don't have then they probably relate to addons that you don't have installed and should be skipped. Always take backups of files you are replacing or keep a copy of the manual installer for your version, and only apply fixes you need. These hotfixes are not necessarily reliable or well supported. Not sure how to extract TAR files to your Windows computer? Try 7-zip (http://www.7-zip.org/).

hotfix-4153, 2020-02-28 12am.tar (34,304 bytes)

Issue History

Date Modified Username Field Change
2020-02-28 00:31 Chris Graham Relationship added has duplicate 0004149