ERROR_LOCK_TIMEOUT with latest dailies?

McRib

Joined: 2005-02-01
Posts: 13
Posted: Tue, 2005-02-01 08:54

Hello,

first of all I want to conragtulate you to this fantastic product - it is
really outstanding.
Now down to business ... I have been running a test system with a daily build from early Jan and everything was fine (Win2k server, PHP4, MySQL 4.1, ImageMagick 6.1.8).
Yesterday I wanted to try a new build and did run into problems.
I tried different OS'es and configs but the error stayed the same:
If I am adding items (no matter if "Web", "Remote" or "Applet", no matter if "generate thumbnails" ticked or not) if takes some seconds and I get the error below.
However the image has been loaded and the next time the album is opened the thumb is generated correctly ...
Find below the error from my "reference system" - other configs tested are:
Win XP Pro, Apache 2.0.52, MySql 4.1.8 and 4.1.9, PHP 4 and 5.0.3 either as cgi or module, either ImageMagick 6.1.9 or GD

----

Error (ERROR_LOCK_TIMEOUT)

* in modules/core/classes/helpers/GalleryLockHelper_medium.class at line 424
* in modules/core/classes/helpers/GalleryLockHelper_medium.class at line 189
* in modules/core/classes/helpers/GalleryItemHelper_medium.class at line 500
* in modules/core/classes/helpers/GalleryItemHelper_medium.class at line 249
* in modules/core/ItemAddFromBrowser.inc at line 79
* in modules/core/ItemAdd.inc at line 74
* in main.php at line 149
* in main.php at line 61

System Information
Gallery version 2.0-alpha-4+ (todays nightly build)
PHP version 4.2.2 apache2filter
Webserver Apache/2.0.40 (Red Hat Linux 9.0)
Database mysql 3.23.58
Toolkits ImageMagick, NetPBM
Operating system Linux stripples.devel.redhat.com 2.4.21-1.1931.2.274.entsmp #1 SMP Tue Jun 24 11:18:10 EDT 2003 i686 i686 i386 GNU/Linux
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.5) Gecko/20041108 Firefox/1.0

 
McRib

Joined: 2005-02-01
Posts: 13
Posted: Tue, 2005-02-01 10:17

P.S.: The data directory is not on NFS or other means of remote storage ...
P.P.S.: Upload from server directory - same result

 
sddroog

Joined: 2005-02-01
Posts: 132
Posted: Tue, 2005-02-01 14:55
McRib wrote:
If I am adding items (no matter if "Web", "Remote" or "Applet", no matter if "generate thumbnails" ticked or not) if takes some seconds and I get the error below.

Same here. No mather what I try, I can not add any items to the gallery.

 
volksport
volksport's picture

Joined: 2002-10-06
Posts: 239
Posted: Tue, 2005-02-01 19:21

I believe this is a lock issue that behaves differently on windows, and was created within the last few days by me. A temporary fix for windows users can be to comment out the code I added (which is simple), until a new way to create locks is created.

to comment out the code, go to:
modules/core/classes/helpers/GalleryItemHelper_medium.class
the fifth function is called addExistingItemToAlbum

at the very end of this function find this code:

	$alreadyLocked = GalleryCoreApi::isWriteLocked($albumId);
	if(!$alreadyLocked) {
            list ($ret, $lockId) = GalleryCoreApi::acquireWriteLock($albumId);
            if ($ret->isError()) {
                return $ret->wrap(__FILE__, __LINE__);
            }
	}

        list ($ret, $parentAlbum) = GalleryCoreApi::loadEntitiesById($albumId);
        if ($ret->isError()) {
            return $ret->wrap(__FILE__, __LINE__);
        }

        $parentAlbum->setModificationTimestamp(time());
        $ret = $parentAlbum->save();
        if ($ret->isError()) {
            return $ret->wrap(__FILE__, __LINE__);
        }
	
	if (!$alreadyLocked) {
            $ret = GalleryCoreApi::releaseLocks($lockId);
            if ($ret->isError()) {
                return $ret->wrap(__FILE__, __LINE__);
            }
	}

on the line before the code starts add a forward slash and an asterisk: /*
on the line after my code ends, add an asterisk and a forward slash: */

this *should* fix your issue for now. if it doesn't, or your computer a'splodes or something - then sorry :(

 
McRib

Joined: 2005-02-01
Posts: 13
Posted: Tue, 2005-02-01 19:35

Hello Bob,

like I told before tha regression is not only noticable
on Windows machines but also on Linux.

Thanks for the quick reply,
Mark

 
volksport
volksport's picture

Joined: 2002-10-06
Posts: 239
Posted: Tue, 2005-02-01 19:55

yea, i didn't notice that - i tend to skim through things. I am sure someone else will chime in soon.

 
virshu
virshu's picture

Joined: 2003-09-13
Posts: 314
Posted: Tue, 2005-02-01 20:18

McRib, like volksport said - we can consistently see this problem on Windows, but couldn't see it on Linux... Did commenting out code block help?

 
sddroog

Joined: 2005-02-01
Posts: 132
Posted: Tue, 2005-02-01 21:00
virshu wrote:
McRib, like volksport said - we can consistently see this problem on Windows, but couldn't see it on Linux... Did commenting out code block help?

I run Linux and removing this code did help me!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-02-01 21:07

it will be removed from cvs today, until we resolve the underlying problem.

 
McRib

Joined: 2005-02-01
Posts: 13
Posted: Tue, 2005-02-01 21:41

Hi guys,

it did do it for me on both Windows and Linux.

Thanks!

 
tezza
tezza's picture

Joined: 2004-12-07
Posts: 18
Posted: Sun, 2005-02-06 13:28
mindless wrote:
it will be removed from cvs today, until we resolve the underlying problem.

Hello there.

I'm running "nice commits" on a debian (stable) box with PHP4 and I'm getting the same error. I went searching for the abovementioned code to comment out, but it doesn not exist in my version of G2. Here is the stack

Error (ERROR_LOCK_TIMEOUT)

* in modules/core/classes/helpers/GalleryLockHelper_medium.class at line 425
* in modules/core/classes/helpers/GalleryLockHelper_medium.class at line 189
* in modules/randomhighlight/classes/RandomHighlightDerivativeImage.class at line 87
* in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 74
* in modules/core/classes/helpers/GalleryDerivativeHelper_medium.class at line 201
* in modules/core/classes/helpers/GalleryDerivativeHelper_medium.class at line 58
* in modules/randomhighlight/classes/RandomHighlightDerivativeImage.class at line 77
* in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 74
* in modules/core/classes/helpers/GalleryDerivativeHelper_advanced.class at line 525
* in modules/randomhighlight/classes/RandomHighlightDerivativeImage.class at line 97
* in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 74
* in modules/core/classes/helpers/GalleryDerivativeHelper_medium.class at line 201
* in modules/core/classes/helpers/GalleryDerivativeHelper_medium.class at line 58
* in modules/randomhighlight/classes/RandomHighlightDerivativeImage.class at line 77
* in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 74
* in modules/core/classes/helpers/GalleryDerivativeHelper_medium.class at line 201
* in modules/core/classes/helpers/GalleryDerivativeHelper_medium.class at line 58
* in modules/core/module.inc at line 259
* in modules/core/classes/GalleryLayout.class at line 523
* in layouts/matrix/layout.inc at line 256
* in layouts/matrix/layout.inc at line 158
* in modules/core/ShowItem.inc at line 126
* in modules/core/classes/GalleryView.class at line 246

Please let me know if I need to provide more information to assist wtih debugging this.

THanks.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2005-02-06 15:38

tezza, your error is not related to this.
Please upgrade to current cvs or nightly snapshot and let us know if you can reproduce the problem (in a new topic).

 
tezza
tezza's picture

Joined: 2004-12-07
Posts: 18
Posted: Mon, 2005-02-07 00:53
mindless wrote:
tezza, your error is not related to this.
Please upgrade to current cvs or nightly snapshot and let us know if you can reproduce the problem (in a new topic).

Right oh then. I've followed your advice and I've created a new topic at

http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=117383#117383