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

Appy commented on HBASE-14734:
------------------------------

I don't think the issue here is related to restriction on being able to run 
only single KDC at a time. Minikdc comments say that the restriction is because 
of two system level properties, but those properties are not used until 
[here|https://github.com/apache/hadoop/blob/branch-2.6.0/hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java#L461]
 and that too, just to write a file. If we ever reached there, the kdc starting 
later would have overwritten the file and the test which were using old kdc 
would have started using new kdc and started failing.

But the failure we are seeing is happening because the port gets allocated 
[here|https://github.com/apache/hadoop/blob/branch-2.6.0/hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java#L270]
 (in MiniKdc's constructor), but gets binded to 
[here|http://grepcode.com/file/repo1.maven.org/maven2/org.apache.directory.server/apacheds-protocol-kerberos/1.5.7/org/apache/directory/server/kerberos/kdc/KdcServer.java#511]
 (on calling MiniKdc.start()-->MiniKdc.initKDCServer() --> KdcServer.start()). 
And in meantime, some other service captures the port. It seems that this can 
happen frequently enough to justify the rate with which we see the errors.



(Note that the code links are from hadoop-2.6.0 branch because the minikdc code 
in hadoop master is significantly different).

> TestGenerateDelegationToken fails with BindAddress clash
> --------------------------------------------------------
>
>                 Key: HBASE-14734
>                 URL: https://issues.apache.org/jira/browse/HBASE-14734
>             Project: HBase
>          Issue Type: Sub-task
>          Components: flakey, test
>            Reporter: stack
>
> From 
> https://builds.apache.org/view/H-L/view/HBase/job/HBase-1.2/330/jdk=latest1.7,label=Hadoop/testReport/junit/org.apache.hadoop.hbase.security.token/TestGenerateDelegationToken/org_apache_hadoop_hbase_security_token_TestGenerateDelegationToken/
> Error Message
> Address already in use
> Stacktrace
> java.net.BindException: Address already in use
>       at sun.nio.ch.Net.bind0(Native Method)
>       at sun.nio.ch.Net.bind(Net.java:444)
>       at sun.nio.ch.Net.bind(Net.java:436)
>       at 
> sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
>       at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
>       at 
> org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:198)
>       at 
> org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:51)
>       at 
> org.apache.mina.core.polling.AbstractPollingIoAcceptor.registerHandles(AbstractPollingIoAcceptor.java:547)
>       at 
> org.apache.mina.core.polling.AbstractPollingIoAcceptor.access$400(AbstractPollingIoAcceptor.java:68)
>       at 
> org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:422)
>       at 
> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>       at java.lang.Thread.run(Thread.java:745)
> Can this utility be made to not fail if address taken? Try another?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to