Github user nicom commented on the pull request:

    https://github.com/apache/storm/pull/639#issuecomment-203982738
  
    @caofangkun 
    
    Sorry for commenting on such an old pull request, but we recently also 
encountered the problem this patch is trying to address.
    
    > Does have any situation will call (.close socket) but not removed from 
cached-node+port->socket ?
    
    Indeed there is one other situation where the close() method is called:
    
https://github.com/apache/storm/blob/v0.9.6/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java#L505
    
    This only happens if the number of reconnects reaches the number set in the 
'storm.messaging.netty.max_retries' config setting (I believe the default is 
300). But the problem is aggravated by the fact, that the `connectionAttempts` 
counter is never reset. So if a topology runs for a long enough time this might 
become a problem.
    Actually this issue has been fixed in 0.10.0
    
    There is another more serious issue that lead to huge problem in one of out 
topologies whenever a worker crashed due to some exception.
    If worker A sucessfully connects to worker B for the first time during 
startup but worker B closes the connection for some reason before the 
`:worker-active-flag` is set to true (here 
https://github.com/apache/storm/blob/v0.9.6/storm-core/src/clj/backtype/storm/daemon/worker.clj#L356),
 there will be no further reconnect attempts, since no messages will be 
processed and neither `send()` nor `flushMessages()` will ever be called.
    
    In our case this frequenty happened because nimbus often rescheduled the 
whole toplogy right around the same time when the supervisor restarted the 
failed worker, leading to a race condition. This might have to do with the fact 
that `nimbus.task.timeout.secs` and `supervisor.worker.timeout.secs` have the 
same value by default.
    
    Tedxia's patch won't fix this problem I belive, since the status returned 
by `status()` will be `ConnectionWithStatus$Status/Connecting` in this 
situation.
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to