Robert Joseph Evans created STORM-497:
-----------------------------------------
Summary: b.s.m.netty.Server.getMessageQueueId is not thread safe,
and can return null
Key: STORM-497
URL: https://issues.apache.org/jira/browse/STORM-497
Project: Apache Storm (Incubating)
Issue Type: Bug
Affects Versions: 0.9.3-incubating
Reporter: Robert Joseph Evans
Priority: Critical
b.s.m.netty.Server.getMessageQueueId
https://github.com/apache/incubator-storm/blob/c5c3571ca15ee2dd675fb3cac44bd0f926ccfc67/storm-core/src/jvm/backtype/storm/messaging/netty/Server.java#L132-150
If there is contention when updating taskToQueueId subsequent threads through
the synchronized block do not set queueId and the function returns null.
Also reading from a HashMap while someone else is updating it, even with a lock
held, can result in a deadlock. I have seen this happen before on Hadoop. It
is likely to be very rare, but I would rather use transactional memory, aka an
AtomicReference, to avoid this entirely.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)