[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455486#comment-13455486
 ] 

Sijie Guo commented on BOOKKEEPER-402:
--------------------------------------

my only concern about your patch is that you constructs another mapping in 
SubHandler to maintain a list of subscribers for each topic. But this 
information is already in AbstractSubscriptionManager. so why not stop delivery 
those subscriber in AbstractSubscriptionManager, that what I did in 
BOOKKEEPER-252? the way works same as your patch, since it stops delivery right 
before notifyUnsubcribe.

besides that, your code to clearTopicForHost is a good point. but there is a 
small bug, which introduces NullPointerException, since it doesn't check 
whether the topic list is null or not. I included and fixed the 
clearTopicForHost in BOOKKEEPER-252. 

AbstractSubscriptionManager.java
{code}
                 private void finish() {
+                    // tell delivery manager to stop delivery for 
subscriptions of this     topic
+                    final Map<ByteString, InMemorySubscriptionState> 
topicSubscriptions =   top2sub2seq.get(topic);
+                    // no subscriptions now, it may be removed by other 
release ops
+                    if (null != topicSubscriptions) {
+                        for (ByteString subId : topicSubscriptions.keySet()) {
+                            if (logger.isDebugEnabled()) {
+                                logger.debug("Stop serving subscriber (" + 
topic.           toStringUtf8() + ", "
+                                           + subId.toStringUtf8() + ") when 
losing topic");+                            }
+                            if (null != dm) {
+                                dm.stopServingSubscriber(topic, subId);
+                            }
+                        }
+                    }
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("Stop serving topic " + 
topic.toStringUtf8());
+                    }
                     topic2LocalCounts.remove(topic);
                     notifyUnsubcribe(topic);
{code}


                
> Hedwig hub should close subscription channels on losing a topic
> ---------------------------------------------------------------
>
>                 Key: BOOKKEEPER-402
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-402
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: hedwig-server
>            Reporter: Aniruddha
>
> If a hub were to lose a topic, it doesn't stop delivery for that topic and 
> keeps the subscription channels open. It should actively close it and stop 
> delivery for all subscribers for that topic connected to it. 
> Reviewboard entry: https://reviews.apache.org/r/7054/

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to