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

Erik Krogen commented on HADOOP-16395:
--------------------------------------

Hi [~hfyang20071], good point regarding {{Closeable}} being IO-specific. In 
this case, maybe 
[{{AutoCloseable}}|https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html],
 which is not IO-specific, would be suitable?

I'm a little worried about the new implementation of {{swapQueue}}:
{code}
    // Our current queue becomes the old queue
    BlockingQueue<E> oldQ = putRef.get();

    if (oldQ instanceof CloseableQueue) {
      ((CloseableQueue) oldQ).close();
    }

    RpcScheduler newScheduler = createScheduler(schedulerClass, priorityLevels,
        ns, conf);
    BlockingQueue<E> newQ = createCallQueueInstance(queueClassToUse,
        priorityLevels, maxSize, ns, conf);

    // Swap putRef first: allow blocked puts() to be unblocked
    putRef.set(newQ);

    // Wait for handlers to drain the oldQ
    while (!queueIsReallyEmpty(oldQ)) {}
{code}
We close the queue at the start of this block, but it is still expected to be 
operational at this time -- see the last line where we are still draining from 
its queue. I know that for the FCQ implementation specifically this is fine 
since {{close()}} only affects the metrics proxy, but generally it seems odd to 
close something and then continue to use it. Is it possible for us to close it 
later, or will it mess up the proxy to instantiate the new one first?

> when CallQueueManager swap queues, we should remove metrics about FCQ
> ---------------------------------------------------------------------
>
>                 Key: HADOOP-16395
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16395
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: common, ipc
>    Affects Versions: 3.2.0
>            Reporter: yanghuafeng
>            Priority: Minor
>         Attachments: HADOOP-16395.001.patch, HADOOP-16395.002.patch
>
>
> when we use "dfsadmin -refreshCallQueue" between FCQ and LBQ, we find that 
> the metrics about FCQ still display by the JMX. Normally the metrics should 
> disappear like what  DecayRpcScheduler did. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to