Project

General

Profile

Actions

Feature #18557

closed

Integrate locking by database in t3lib_lock

Added by Oliver Hader almost 16 years ago. Updated almost 4 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
Category:
Locking / Session Handling
Target version:
-
Start date:
2008-04-03
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

Description

In environments with more than one webserver, locking on using the filesystem might not be a good idea since synchronisation of those information is too slow. A possibility is to use the database storage for locking.
This issue is not about database transactions but more about storing a locking semaphore in the database.

A new locking mode besides simple, flock, semaphore and disable shall be integrated: <b>database</b>

(issue imported from #M8010)


Files

oracle__typo3_dbLock.zip (933 Bytes) oracle__typo3_dbLock.zip Administrator Admin, 2008-04-03 18:08
0008010.patch (4.71 KB) 0008010.patch Administrator Admin, 2008-04-03 18:14
0008010_v2.patch (2.9 KB) 0008010_v2.patch Administrator Admin, 2008-04-21 14:43
0008010_v3.patch (4.12 KB) 0008010_v3.patch Administrator Admin, 2010-07-21 16:40

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #24342: t3lib_lock still sometimes has a race condition on deleting locks.Closed2010-12-15

Actions
Actions #1

Updated by Steffen Kamper almost 16 years ago

+1
this can also be useful if someone edit a record, it can be locked for other users.

Actions #2

Updated by Oliver Hader almost 16 years ago

I attached an intial version (experimental and not much tested).
Since the patch extends the TYPO3_DB object, also DBAL should be envolved in using these locks. A "typo3_dbLock" package for Oracle is attached (thanks a lot to "Sigi").

Actions #3

Updated by Oliver Hader almost 16 years ago

MySQL's GET_LOCK() is a no-go. The following "locking" in one process will release the first lock:
SELECT GET_LOCK('lock1', 10);
SELECT GET_LOOK('lock2', 20); --> releases 'lock1'

Actions #4

Updated by Oliver Hader almost 16 years ago

The new patch creates a sys_lock table which holds these locks.
When the database hammers/polls if a lock is active, the information will come from the database cache until the lock is released or changed.

I see no other possibility to implement such a lock for a concurrent scenario.

Actions #5

Updated by Ernesto Baschny over 13 years ago

Sounds great, Olly. Any way to test or use this kind of locking?

Currently I only see the page generation using t3lib_lock in the core. It's type can be set using ['SYS']['lockingMode'], which defaults to 'simple'.

Maybe we can introduce the new DB based locking to the core and test it using that lock? And later on we can make use of it for other situations.

Actions #7

Updated by Xavier Perseguers over 12 years ago

  • Category deleted (Communication)
  • Status changed from Accepted to New
  • Assignee deleted (Oliver Hader)
  • Target version changed from 4.6.0 to 4.6.0-beta1
Actions #8

Updated by Xavier Perseguers over 12 years ago

  • Target version deleted (4.6.0-beta1)
Actions #9

Updated by Christian Kuhn over 12 years ago

I'm unsure if we really need an own table for this. Probably the registry could be used for this, too.

Actions #10

Updated by Ingo Renner over 12 years ago

I agree, this is a perfect job for the registry...

Actions #11

Updated by Helmut Hummel over 12 years ago

  • Assignee set to Helmut Hummel

I take care of this

Actions #12

Updated by Mathias Schreiber about 9 years ago

  • Status changed from New to Needs Feedback

Still taking care? ;-)

Actions #13

Updated by Helmut Hummel about 9 years ago

  • Status changed from Needs Feedback to Rejected
  • Assignee deleted (Helmut Hummel)

nope

Actions #14

Updated by Susanne Moog almost 5 years ago

  • Category set to Locking / Session Handling
  • Status changed from Rejected to New

The feature would still be nice (now on the new locking strategy framework) to provide cluster compatible locking ootb.

Actions #15

Updated by Benni Mack almost 5 years ago

  • Status changed from New to Accepted
  • Assignee set to Benni Mack

Will take care of this

Actions #16

Updated by Benni Mack almost 4 years ago

  • Status changed from Accepted to Rejected

We now have an API in place (since TYPO3 v10) to build this properly - otherwise I recommend using "distributed locks" (see https://github.com/b13/distributed-locks)

Actions

Also available in: Atom PDF