You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Anil Gangolli <an...@busybuddha.org> on 2006/12/01 17:03:38 UTC

Fw: 3.1 RC1 - Taskmanagement - ResetHitcoutTask


Shouldn't there be some uniqueness constraint on the NAME column preventing 
a lease from being acquired twice?

----- Original Message ----- 
From: "Thomas-W Hofmann" <th...@db.com>
To: <ro...@incubator.apache.org>
Sent: Friday, December 01, 2006 6:46 AM
Subject: 3.1 RC1 - Taskmanagement - ResetHitcoutTask


> ResetHitCountsTask is shown twice and does not run nor go away after
> restart ?
>
> ID                                NAME                  ISLOCKED
> TIMEACQUIRED             TIMELEASED     LASTRUN
> --------------------------------  --------------------  ----------- 
> -----------------------  -------------  ----------------------- 
> 8a0cb4910f0b83dd010f0b8415490001  PingQueueTask         0 2006-12-01
> 14:40:41.825  30             2006-12-01 14:40:41.825
> 8a0cbbc00f0b8b8c010f0cf638350019  ResetHitCountsTask    0 2006-11-22
> 00:00:00.053  30             2006-11-22 00:00:00.053
> 8a0cbbc80f2f32e6010f2f3b79690003  SyncWebsitesTask      0 2006-12-01
> 12:00:00.047  30             2006-12-01 12:00:00.047
> 8a0cbbc80f0b8b9c010f0cf6382e0001  ResetHitCountsTask    1 2006-11-22
> 00:00:00.046  30             2006-11-22 00:00:00.046
> 8a0cbbc80f2f32e6010f2f3c42ee0004  RefreshEntriesTask    0 2006-12-01
> 13:00:00.057  30             2006-12-01 13:00:00.057
> 8a0cb4910f0b8b72010f0cf638100003  TurnoverReferersTask  0 2006-11-30
> 00:00:00.038  30             2006-11-30 00:00:00.038
>
> Any ideas ?
> Thomas
>
>
>
>
> --
>
> Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte 
> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail 
> irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und 
> vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte 
> Weitergabe dieser Mail ist nicht gestattet.
>
> This e-mail may contain confidential and/or privileged information. If you 
> are not the intended recipient (or have received this e-mail in error) 
> please notify the sender immediately and destroy this e-mail. Any 
> unauthorized copying, disclosure or distribution of the material in this 
> e-mail is strictly forbidden. 


Re: 3.1 RC1 - Taskmanagement - ResetHitcoutTask

Posted by Thomas Hofmann <th...@db.com>.
Hi,

You might consider the following to get this solved :
(We solved the problem with our infrastructur in the following way) 

-Instead (or in addition to the ID key) use the servers IP-Address.

-The server which first aquires the handle locks the whole task until its
tomcat engine shuts down.

-On startup or shutdown of the Tomcat engine release all aquired handles
(using servers IP address).

-Add parameters to roller.properties to specify allowed IP adresses to run
background jobs !

This way you have full external control of whats going on (you always can
tell which server is running the jobs and which logfile to look at. In
addition we do not want any jobs running on the staging server.  Further on
server crash you have a cleaned up table after the server restarts.


Feel free to ask further questions about our setup.
Thomas



Anil Gangolli wrote:
> 
> 
> Reviewing the lock code, I believe there are some potential race
> conditions.
> 
> In addition to the name uniqueness, one needs a generation number/version
> to 
> avoid multiple threads/processes updating the same row and thinking that 
> they own the lock.
> 
> --a.
> 
> 
> ----- Original Message ----- 
> From: "Anil Gangolli" <an...@busybuddha.org>
> To: <ro...@incubator.apache.org>
> Sent: Friday, December 01, 2006 8:03 AM
> Subject: Fw: 3.1 RC1 - Taskmanagement - ResetHitcoutTask
> 
> 
>>
>>
>> Shouldn't there be some uniqueness constraint on the NAME column 
>> preventing a lease from being acquired twice?
>>
>> ----- Original Message ----- 
>> From: "Thomas-W Hofmann" <th...@db.com>
>> To: <ro...@incubator.apache.org>
>> Sent: Friday, December 01, 2006 6:46 AM
>> Subject: 3.1 RC1 - Taskmanagement - ResetHitcoutTask
>>
>>
>>> ResetHitCountsTask is shown twice and does not run nor go away after
>>> restart ?
>>>
>>> ID                                NAME                  ISLOCKED
>>> TIMEACQUIRED             TIMELEASED     LASTRUN
>>> --------------------------------  --------------------  ----------- 
>>> -----------------------  -------------  ----------------------- 
>>> 8a0cb4910f0b83dd010f0b8415490001  PingQueueTask         0 2006-12-01
>>> 14:40:41.825  30             2006-12-01 14:40:41.825
>>> 8a0cbbc00f0b8b8c010f0cf638350019  ResetHitCountsTask    0 2006-11-22
>>> 00:00:00.053  30             2006-11-22 00:00:00.053
>>> 8a0cbbc80f2f32e6010f2f3b79690003  SyncWebsitesTask      0 2006-12-01
>>> 12:00:00.047  30             2006-12-01 12:00:00.047
>>> 8a0cbbc80f0b8b9c010f0cf6382e0001  ResetHitCountsTask    1 2006-11-22
>>> 00:00:00.046  30             2006-11-22 00:00:00.046
>>> 8a0cbbc80f2f32e6010f2f3c42ee0004  RefreshEntriesTask    0 2006-12-01
>>> 13:00:00.057  30             2006-12-01 13:00:00.057
>>> 8a0cb4910f0b8b72010f0cf638100003  TurnoverReferersTask  0 2006-11-30
>>> 00:00:00.038  30             2006-11-30 00:00:00.038
>>>
>>> Any ideas ?
>>> Thomas
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte 
>>> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese 
>>> E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den 
>>> Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
>>> die 
>>> unbefugte Weitergabe dieser Mail ist nicht gestattet.
>>>
>>> This e-mail may contain confidential and/or privileged information. If 
>>> you are not the intended recipient (or have received this e-mail in 
>>> error) please notify the sender immediately and destroy this e-mail. Any 
>>> unauthorized copying, disclosure or distribution of the material in this 
>>> e-mail is strictly forbidden.
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Fw%3A-3.1-RC1---Taskmanagement---ResetHitcoutTask-tf2738764s12275.html#a7675774
Sent from the Roller - Dev mailing list archive at Nabble.com.


Re: 3.1 RC1 - Taskmanagement - ResetHitcoutTask

Posted by Anil Gangolli <an...@busybuddha.org>.
Reviewing the lock code, I believe there are some potential race conditions.

In addition to the name uniqueness, one needs a generation number/version to 
avoid multiple threads/processes updating the same row and thinking that 
they own the lock.

--a.


----- Original Message ----- 
From: "Anil Gangolli" <an...@busybuddha.org>
To: <ro...@incubator.apache.org>
Sent: Friday, December 01, 2006 8:03 AM
Subject: Fw: 3.1 RC1 - Taskmanagement - ResetHitcoutTask


>
>
> Shouldn't there be some uniqueness constraint on the NAME column 
> preventing a lease from being acquired twice?
>
> ----- Original Message ----- 
> From: "Thomas-W Hofmann" <th...@db.com>
> To: <ro...@incubator.apache.org>
> Sent: Friday, December 01, 2006 6:46 AM
> Subject: 3.1 RC1 - Taskmanagement - ResetHitcoutTask
>
>
>> ResetHitCountsTask is shown twice and does not run nor go away after
>> restart ?
>>
>> ID                                NAME                  ISLOCKED
>> TIMEACQUIRED             TIMELEASED     LASTRUN
>> --------------------------------  --------------------  ----------- 
>> -----------------------  -------------  ----------------------- 
>> 8a0cb4910f0b83dd010f0b8415490001  PingQueueTask         0 2006-12-01
>> 14:40:41.825  30             2006-12-01 14:40:41.825
>> 8a0cbbc00f0b8b8c010f0cf638350019  ResetHitCountsTask    0 2006-11-22
>> 00:00:00.053  30             2006-11-22 00:00:00.053
>> 8a0cbbc80f2f32e6010f2f3b79690003  SyncWebsitesTask      0 2006-12-01
>> 12:00:00.047  30             2006-12-01 12:00:00.047
>> 8a0cbbc80f0b8b9c010f0cf6382e0001  ResetHitCountsTask    1 2006-11-22
>> 00:00:00.046  30             2006-11-22 00:00:00.046
>> 8a0cbbc80f2f32e6010f2f3c42ee0004  RefreshEntriesTask    0 2006-12-01
>> 13:00:00.057  30             2006-12-01 13:00:00.057
>> 8a0cb4910f0b8b72010f0cf638100003  TurnoverReferersTask  0 2006-11-30
>> 00:00:00.038  30             2006-11-30 00:00:00.038
>>
>> Any ideas ?
>> Thomas
>>
>>
>>
>>
>> --
>>
>> Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte 
>> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese 
>> E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den 
>> Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die 
>> unbefugte Weitergabe dieser Mail ist nicht gestattet.
>>
>> This e-mail may contain confidential and/or privileged information. If 
>> you are not the intended recipient (or have received this e-mail in 
>> error) please notify the sender immediately and destroy this e-mail. Any 
>> unauthorized copying, disclosure or distribution of the material in this 
>> e-mail is strictly forbidden.
> 


Re: Fw: 3.1 RC1 - Taskmanagement - ResetHitcoutTask

Posted by Anil Gangolli <an...@busybuddha.org>.
There also seems to be a race condition currently even after this where two 
processes load the record think it is free or expired and store it.
That race condition would result in two processes/threads  thinking they own 
the lock.  A version id / generation number used in the update where clause 
(e.g. as in the hibernate optimistic locking mechanism) would fix this.

--a.



----- Original Message ----- 
From: "Allen Gilliland" <al...@sun.com>
To: <ro...@incubator.apache.org>
Sent: Friday, December 01, 2006 9:05 AM
Subject: Re: Fw: 3.1 RC1 - Taskmanagement - ResetHitcoutTask


> Yes, that is a bug and I believe that Elias had pointed this out before. 
> This happens if you happen to be running a task for the first time from 2 
> or more instances which happen to trigger the task at the exact same time. 
> Once the entry is inserted for the first time it shouldn't cause any 
> problems, but this is definitely something that should be addressed.
>
> The easy fix is just to remove one of the duplicated entries ...
>
> delete from roller_tasklock where id = '8a0cbbc00f0b8b8c010f0cf638350019';
>
> -- Allen
>
>
> Anil Gangolli wrote:
>>
>>
>> Shouldn't there be some uniqueness constraint on the NAME column 
>> preventing a lease from being acquired twice?
>>
>> ----- Original Message ----- From: "Thomas-W Hofmann" 
>> <th...@db.com>
>> To: <ro...@incubator.apache.org>
>> Sent: Friday, December 01, 2006 6:46 AM
>> Subject: 3.1 RC1 - Taskmanagement - ResetHitcoutTask
>>
>>
>>> ResetHitCountsTask is shown twice and does not run nor go away after
>>> restart ?
>>>
>>> ID                                NAME                  ISLOCKED
>>> TIMEACQUIRED             TIMELEASED     LASTRUN
>>> --------------------------------  --------------------  ----------- 
>>> -----------------------  -------------  ----------------------- 
>>> 8a0cb4910f0b83dd010f0b8415490001  PingQueueTask         0 2006-12-01
>>> 14:40:41.825  30             2006-12-01 14:40:41.825
>>> 8a0cbbc00f0b8b8c010f0cf638350019  ResetHitCountsTask    0 2006-11-22
>>> 00:00:00.053  30             2006-11-22 00:00:00.053
>>> 8a0cbbc80f2f32e6010f2f3b79690003  SyncWebsitesTask      0 2006-12-01
>>> 12:00:00.047  30             2006-12-01 12:00:00.047
>>> 8a0cbbc80f0b8b9c010f0cf6382e0001  ResetHitCountsTask    1 2006-11-22
>>> 00:00:00.046  30             2006-11-22 00:00:00.046
>>> 8a0cbbc80f2f32e6010f2f3c42ee0004  RefreshEntriesTask    0 2006-12-01
>>> 13:00:00.057  30             2006-12-01 13:00:00.057
>>> 8a0cb4910f0b8b72010f0cf638100003  TurnoverReferersTask  0 2006-11-30
>>> 00:00:00.038  30             2006-11-30 00:00:00.038
>>>
>>> Any ideas ?
>>> Thomas
>>>
>>>
>>>
>>>
>>> -- 
>>>
>>> Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte 
>>> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese 
>>> E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den 
>>> Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie 
>>> die unbefugte Weitergabe dieser Mail ist nicht gestattet.
>>>
>>> This e-mail may contain confidential and/or privileged information. If 
>>> you are not the intended recipient (or have received this e-mail in 
>>> error) please notify the sender immediately and destroy this e-mail. Any 
>>> unauthorized copying, disclosure or distribution of the material in this 
>>> e-mail is strictly forbidden.
>>
> 


Re: Fw: 3.1 RC1 - Taskmanagement - ResetHitcoutTask

Posted by Allen Gilliland <al...@sun.com>.
Yes, that is a bug and I believe that Elias had pointed this out before. 
  This happens if you happen to be running a task for the first time 
from 2 or more instances which happen to trigger the task at the exact 
same time.  Once the entry is inserted for the first time it shouldn't 
cause any problems, but this is definitely something that should be 
addressed.

The easy fix is just to remove one of the duplicated entries ...

delete from roller_tasklock where id = '8a0cbbc00f0b8b8c010f0cf638350019';

-- Allen


Anil Gangolli wrote:
> 
> 
> Shouldn't there be some uniqueness constraint on the NAME column 
> preventing a lease from being acquired twice?
> 
> ----- Original Message ----- From: "Thomas-W Hofmann" 
> <th...@db.com>
> To: <ro...@incubator.apache.org>
> Sent: Friday, December 01, 2006 6:46 AM
> Subject: 3.1 RC1 - Taskmanagement - ResetHitcoutTask
> 
> 
>> ResetHitCountsTask is shown twice and does not run nor go away after
>> restart ?
>>
>> ID                                NAME                  ISLOCKED
>> TIMEACQUIRED             TIMELEASED     LASTRUN
>> --------------------------------  --------------------  ----------- 
>> -----------------------  -------------  ----------------------- 
>> 8a0cb4910f0b83dd010f0b8415490001  PingQueueTask         0 2006-12-01
>> 14:40:41.825  30             2006-12-01 14:40:41.825
>> 8a0cbbc00f0b8b8c010f0cf638350019  ResetHitCountsTask    0 2006-11-22
>> 00:00:00.053  30             2006-11-22 00:00:00.053
>> 8a0cbbc80f2f32e6010f2f3b79690003  SyncWebsitesTask      0 2006-12-01
>> 12:00:00.047  30             2006-12-01 12:00:00.047
>> 8a0cbbc80f0b8b9c010f0cf6382e0001  ResetHitCountsTask    1 2006-11-22
>> 00:00:00.046  30             2006-11-22 00:00:00.046
>> 8a0cbbc80f2f32e6010f2f3c42ee0004  RefreshEntriesTask    0 2006-12-01
>> 13:00:00.057  30             2006-12-01 13:00:00.057
>> 8a0cb4910f0b8b72010f0cf638100003  TurnoverReferersTask  0 2006-11-30
>> 00:00:00.038  30             2006-11-30 00:00:00.038
>>
>> Any ideas ?
>> Thomas
>>
>>
>>
>>
>> -- 
>>
>> Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte 
>> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese 
>> E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den 
>> Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie 
>> die unbefugte Weitergabe dieser Mail ist nicht gestattet.
>>
>> This e-mail may contain confidential and/or privileged information. If 
>> you are not the intended recipient (or have received this e-mail in 
>> error) please notify the sender immediately and destroy this e-mail. 
>> Any unauthorized copying, disclosure or distribution of the material 
>> in this e-mail is strictly forbidden. 
>