Bug #31460

flock() in class.t3lib_div.php

Added by Timm almost 4 years ago. Updated over 3 years ago.

Status:Resolved Start date:2011-10-31
Priority:Should have Due date:
Assigned To:Dmitry Dulepov % Done:

100%

Category:- Spent time: -
Target version:-
TYPO3 Version:4.6 Is Regression:
PHP Version:5.3 Sprint Focus:
Complexity:

Description

Hi,

we're serving T3 v4.6.0 from NFS. First thanks for the last release with some alternative locking methods.

At line 5499 and 5584 in file ./typo3_src-4.6.0/t3lib/class.t3lib_div.php we found some flock()-calls wich breaks down php.

Our workaround is to comment out the flock()s.

Support for new locking methods in class.t3lib_div.php would be great.

There are also some other files with flock():

./typo3_src-4.6.0/typo3/sysext/adodb/adodb/adodb-active-record.inc.php:361: @flock($fp, LOCK_SH);
./typo3_src-4.6.0/typo3/sysext/adodb/adodb/adodb-active-recordx.inc.php:420: @flock($fp, LOCK_SH);
./typo3_src-4.6.0/typo3/sysext/adodb/adodb/adodb-csvlib.inc.php:103: @flock($fp, LOCK_SH);
./typo3_src-4.6.0/typo3/sysext/adodb/adodb/adodb-csvlib.inc.php:305: if (flock($fd, LOCK_EX) && ftruncate($fd, 0)) {
./typo3_src-4.6.0/t3lib/mail/class.t3lib_mail_mboxtransport.php:101: flock($file, LOCK_EX);
./typo3_src-4.6.0/t3lib/mail/class.t3lib_mail_mboxtransport.php:103: flock($file, LOCK_UN);

Regards,

timm


Related issues

related to Core - Bug #34662: Fatal error 't3lib_lock' does not exist if deprecationLog... Resolved 2012-03-08
related to Core - Bug #18716: Acquired lock/Released lock entries in system log Resolved 2008-04-28

Associated revisions

Revision 075e1a12
Added by Dmitry Dulepov over 3 years ago

[BUGFIX] flock() calls in TYPO3 prevent NFS hosting

flock() happens in several places in TYPO3. This function does
not work properly on NFS shares. t3lib_lock should be used
instead.

Change-Id: I30392bf06c5e20e27e929fb06d77ee9f96978902
Resolves: #31460
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/6778
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Xavier Perseguers
Reviewed-by: Steffen Gebert
Tested-by: Steffen Gebert

Revision d083f5af
Added by Dmitry Dulepov over 3 years ago

[BUGFIX] flock() calls in TYPO3 prevent NFS hosting

flock() happens in several places in TYPO3. This function does
not work properly on NFS shares. t3lib_lock should be used
instead.

Change-Id: I30392bf06c5e20e27e929fb06d77ee9f96978902
Resolves: #31460
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/7504
Reviewed-by: Stefan Neufeind
Reviewed-by: Oliver Klee
Reviewed-by: Steffen Ritter
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers

Revision f1fd1b69
Added by Dmitry Dulepov over 3 years ago

[BUGFIX] flock() calls in TYPO3 prevent NFS hosting

flock() happens in several places in TYPO3. This function does
not work properly on NFS shares. t3lib_lock should be used
instead.

Change-Id: I30392bf06c5e20e27e929fb06d77ee9f96978902
Resolves: #31460
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/7506
Reviewed-by: Stefan Neufeind
Reviewed-by: Oliver Klee
Reviewed-by: Ivan Dharma Kartolo
Tested-by: Ivan Dharma Kartolo
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter

History

#1 Updated by Francois Suter almost 4 years ago

Hi Timm, thanks for reporting. I must admit that I'm not at all into the locking mechanism, I hope someone else can help you.

Would you be able to provide a patch yourself? It would greatly enhance the chances of seeing those changes made to the TYPO3 Core.

BTW I don't think the flock's inside adodb will be changed, as this is just included as a contribution.

#2 Updated by Dmitry Dulepov over 3 years ago

  • Status changed from New to Under Review
  • Assigned To set to Dmitry Dulepov

#3 Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6778

#4 Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/7504

#5 Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/7506

#6 Updated by Dmitry Dulepov over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Gerrit Code Review over 3 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/9360

#8 Updated by Dmitry Dulepov over 3 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF