[JBoss JIRA] (JGRP-2360) DeadLock while acqiring a distributed lock consecutively by the same thread in a loop
by Daniel Klosinski (Jira)
Daniel Klosinski created JGRP-2360:
--------------------------------------
Summary: DeadLock while acqiring a distributed lock consecutively by the same thread in a loop
Key: JGRP-2360
URL: https://issues.jboss.org/browse/JGRP-2360
Project: JGroups
Issue Type: Bug
Affects Versions: 4.1.1, 3.6.18
Environment: JGroups-4.1.1-Final
Red Hat 4.4.7-23
JDK 1.8.0_202
Reporter: Daniel Klosinski
Assignee: Bela Ban
Attachments: DLTest.java, DistributedLockRepoducer.zip, log.log
Deadlock intermittently happens when trying to acquire a distributed lock by the same VM, consecutively by the same thread in a loop. Here is a code snippet for which this issue can occur :
{code}
for(String s : list){
Lock lock=lock_service.getLock("test_lock_name");
lock.lock();
//perform bussines logic
lock.unlock();
}
{code}
During the troubleshooting, I found out that lock_id is not being incremented for the new distributed lock. In the first two loop iterations everything was fine. At the third iteration lock_id didn't get increased:
{code}
2019-07-15 16:03:32 TRACE CENTRAL_LOCK:163 - svc-2-sps-34594 --> svc-1-sps-4688: GRANT_LOCK[test_lock_name, lock_id=1, owner=svc-2-sps-34594::1]
2019-07-15 16:03:32 TRACE CENTRAL_LOCK:163 - svc-2-sps-34594 <-- svc-1-sps-4688: LOCK_GRANTED[test_lock_name, lock_id=1, owner=svc-2-sps-34594::1, sender=svc-1-sps-4688]
2019-07-15 16:03:32 TRACE CENTRAL_LOCK:163 - svc-2-sps-34594 --> svc-1-sps-4688: RELEASE_LOCK[test_lock_name, lock_id=1, owner=svc-2-sps-34594::1]
2019-07-15 16:03:32 TRACE CENTRAL_LOCK:163 - svc-2-sps-34594 <-- svc-1-sps-4688: RELEASE_LOCK_OK[test_lock_name, lock_id=1, owner=svc-2-sps-34594::1, sender=svc-1-sps-4688]
2019-07-15 16:03:32 TRACE CENTRAL_LOCK:163 - svc-2-sps-34594 --> svc-1-sps-4688: GRANT_LOCK[test_lock_name, lock_id=2, owner=svc-2-sps-34594::1]
2019-07-15 16:03:32 TRACE CENTRAL_LOCK:163 - svc-2-sps-34594 <-- svc-1-sps-4688: LOCK_GRANTED[test_lock_name, lock_id=2, owner=svc-2-sps-34594::1, sender=svc-1-sps-4688]
2019-07-15 16:03:32 TRACE CENTRAL_LOCK:163 - svc-2-sps-34594 --> svc-1-sps-4688: RELEASE_LOCK[test_lock_name, lock_id=2, owner=svc-2-sps-34594::1]
2019-07-15 16:03:32 TRACE CENTRAL_LOCK:163 - svc-2-sps-34594 <-- svc-1-sps-4688: RELEASE_LOCK_OK[test_lock_name, lock_id=2, owner=svc-2-sps-34594::1, sender=svc-1-sps-4688]
2019-07-15 16:03:32 TRACE CENTRAL_LOCK:163 - svc-2-sps-34594 --> svc-1-sps-4688: GRANT_LOCK[test_lock_name, lock_id=2, owner=svc-2-sps-34594::1]
2019-07-15 16:03:32 TRACE CENTRAL_LOCK:163 - svc-2-sps-34594 <-- svc-1-sps-4688: CREATE_LOCK[test_lock_name, owner=svc-2-sps-34594::1, sender=svc-1-sps-4688]
2019-07-15 16:03:32 TRACE CENTRAL_LOCK:163 - svc-2-sps-34594 <-- svc-1-sps-4688: LOCK_GRANTED[test_lock_name, lock_id=2, owner=svc-2-sps-34594::1, sender=svc-1-sps-4688]
{code}
I've added few extra loggers into Jgroups-4.1.1.Final code and I realized that the second client lock was not removed from the client lock table before the creation of 3rd client lock. The issue lays in below piece of code. Owner consists of address and threadID. If the same thread, on the same VM, creates distributed lock consecutively and if there is an existing entry in the client lock table for the same owner, the new lock won't be created. The old client lock will be used to acquire a new distributed lock :
{code}
protected synchronized ClientLock getLock(String name, Owner owner, boolean create_if_absent) {
Map<Owner,ClientLock> owners=table.get(name);
if(owners == null) {
if(!create_if_absent)
return null;
owners=Util.createConcurrentMap(20);
Map<Owner,ClientLock> existing=table.putIfAbsent(name,owners);
if(existing != null)
owners=existing;
}
ClientLock lock=owners.get(owner);
if(lock == null) {
if(!create_if_absent)
return null;
lock=createLock(name, owner);
owners.put(owner, lock);
}
return lock;
}
{code}
I believe that this issue was introduced by the fix for JGRP-2234 and it is caused by the race condition. The logic that deletes client lock from the client lock table is now executed when the client's VM receives RELEASE_LOCK_OK message from the coordinator. Previously this deletion was executed by the thread in which unlock() method was called. Now, it is executed by the separate thread wich handles RELEASE_LOCK_OK from the coordinator and this is why we have a care condition here.
I am attaching a simple program which can be used to reproduce and generated logs.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years
[JBoss JIRA] (DROOLS-4315) [DMN Designer] Documentation - Download buttons UX
by Elizabeth Clayton (Jira)
[ https://issues.jboss.org/browse/DROOLS-4315?page=com.atlassian.jira.plugi... ]
Elizabeth Clayton commented on DROOLS-4315:
-------------------------------------------
Thanks [~karreiro]! This issue potentially also applies to the process designer. Given the target timeframe, should I assume that the short-term solution needs to be specific to the DMN editor? I don't think there's time for a change for process designer as well, correct [~roger.martinez][~tsurdilovic] [~stetson.robinson]?
If so, [~karreiro] what's in our purview to change for the dmn editor - toolbar buttons, or just the buttons on the documentation tab?
> [DMN Designer] Documentation - Download buttons UX
> --------------------------------------------------
>
> Key: DROOLS-4315
> URL: https://issues.jboss.org/browse/DROOLS-4315
> Project: Drools
> Issue Type: Bug
> Components: DMN Editor
> Reporter: Guilherme Gomes
> Assignee: Elizabeth Clayton
> Priority: Major
> Labels: UX, UXTeam, drools-tools
> Attachments: component-1.png, component-2.png, component-3.png
>
>
> h3. Context:
> Today users can:
> 1) Download the diagram picture by using this component:
> !component-1.png|thumbnail!
> 2) Download the DMN file by using this component:
> !component-2.png|thumbnail!
> 3) Print or Download the documentation as PDF by using the *Print* button (into the Documentation tab):
> !component-3.png|thumbnail!
> 4) Download the documentation as DOC by using the *Download .doc file* button (into the Documentation tab):
> !component-3.png|thumbnail!
> ----
> h3. Problem:
> The "Download" concept is getting confusing for users.
> As a user, I want to be able to:
> - Download the documentation as a .PDF file
> - Download the documentation as a .DOC file
> - Print the documentation
> ----
> h3. Notice:
> This component can be removed (if UX considers that it's necessary):
> !component-1.png|thumbnail!
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years
[JBoss JIRA] (ELY-867) Masked password support cryptography usage
by Farah Juma (Jira)
[ https://issues.jboss.org/browse/ELY-867?page=com.atlassian.jira.plugin.sy... ]
Farah Juma updated ELY-867:
---------------------------
Fix Version/s: 1.10.0.CR3
> Masked password support cryptography usage
> ------------------------------------------
>
> Key: ELY-867
> URL: https://issues.jboss.org/browse/ELY-867
> Project: WildFly Elytron
> Issue Type: Bug
> Components: Passwords
> Reporter: Zoran Regvart
> Assignee: Ashley Abdel-Sayed
> Priority: Major
> Fix For: 1.10.0.CR3
>
>
> I encountered couple of issues with cryptography used for password masking:
> * implementation of masked passwords drops initialization vector (IV) randomly generated by the {{javax.crypto.Cipher}} which makes unmasking (decryption) impossible.
> * the implementation is using the same algorithm for key derivation and encryption, which is not possible as there is no encryption support in {{javax.crypto.Cipher}} for PKDBF2 family of algorithms, they are supported only in {{javax.crypto.SecretKeyFactory}}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years