[
https://issues.apache.org/jira/browse/STORM-593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14387056#comment-14387056
]
ASF GitHub Bot commented on STORM-593:
--------------------------------------
Github user nathanmarz commented on a diff in the pull request:
https://github.com/apache/storm/pull/349#discussion_r27413411
--- Diff: storm-core/src/clj/backtype/storm/daemon/worker.clj ---
@@ -335,16 +333,14 @@
drainer (TransferDrainer.)
node+port->socket (:cached-node+port->socket worker)
task->node+port (:cached-task->node+port worker)
- endpoint-socket-lock (:endpoint-socket-lock worker)
]
(disruptor/clojure-handler
(fn [packets _ batch-end?]
(.add drainer packets)
(when batch-end?
- (read-locked endpoint-socket-lock
- (let [node+port->socket @node+port->socket]
- (.send drainer node+port->socket)))
+ (let [node+port->socket @node+port->socket]
+ (.send drainer node+port->socket))
--- End diff --
Taking a look at it again, it looks like the introduction of
TransferDrainer is a regression. The way that class works doesn't make a whole
lot of sense... it has separate add and send methods but those are only ever
used in the same method. Looking up the node+port for the task should happen in
the read lock as well.
> No need of rwlock for clojure atom
> -----------------------------------
>
> Key: STORM-593
> URL: https://issues.apache.org/jira/browse/STORM-593
> Project: Apache Storm
> Issue Type: Improvement
> Affects Versions: 0.10.0
> Reporter: xiajun
> Assignee: xiajun
>
> cached-node+port->socket in worker-data is atom, there on need for rwlock
> endpoint-socket-lock to protect cached-node+port->socket. And after use
> rwlock, there will be competition between refresh-connections and message
> send.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)