[
https://issues.apache.org/jira/browse/OOZIE-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14054381#comment-14054381
]
Purshotam Shah commented on OOZIE-1886:
---------------------------------------
{code}
- boolean accepted;
- lock.lock();
- try {
- accepted = queues[queueElement.getPriority()].offer(queueElement);
- debug("offer([{0}]), to P[{1}] delay[{2}ms] accepted[{3}]",
queueElement.getElement().toString(),
- queueElement.getPriority(),
queueElement.getDelay(TimeUnit.MILLISECONDS), accepted);
- if (accepted) {
- if (currentSize != null) {
- currentSize.incrementAndGet();
- }
- queueElement.inQueue = true;
+ boolean accepted =
queues[queueElement.getPriority()].offer(queueElement);
+ debug("offer([{0}]), to P[{1}] delay[{2}ms] accepted[{3}]",
queueElement.getElement().toString(),
+ queueElement.getPriority(),
queueElement.getDelay(TimeUnit.MILLISECONDS), accepted);
+ if (accepted) {
+ if (currentSize != null) {
+ currentSize.incrementAndGet();
}
- } finally {
- lock.unlock();
+ queueElement.inQueue = true;
}
return accepted;
}
{code}
I was referring to your patch and was trying to explain that we don't need
lock. I am not sure where we modify queueElement in offer.
Thanks for you patch, we had to rollback OOZIE-1699. After this, we can include
OOZIE-1699.
> Queue operation talking longer time
> -----------------------------------
>
> Key: OOZIE-1886
> URL: https://issues.apache.org/jira/browse/OOZIE-1886
> Project: Oozie
> Issue Type: Bug
> Affects Versions: 4.0.1
> Reporter: Shwetha G S
> Assignee: Shwetha G S
> Fix For: trunk
>
> Attachments: OOZIE-1886.patch
>
>
> Purshotam Shah added a comment - 24/May/14 00:36
> We noticed that this fix is causing congestion. Queue operation were talking
> longer time than expected.
> There are two lock being used for queuing commands, which is causing delay.
> First, all queue command function of CallableQueueService is synchronized.
> Second, add function of PriorityDelayQueue need to acquire ReentrantLock
> lock, which was added as part of this patch.
> Acquiring two lock for queueing a single command was slowing down the system.
> Server was taking more than 4 sec, just to queue a command.
> After we rollback this patch and server was back to normal.
--
This message was sent by Atlassian JIRA
(v6.2#6252)