You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "Hemanth Yamijala (JIRA)" <ji...@apache.org> on 2015/11/11 12:03:10 UTC
[jira] [Updated] (ATLAS-297)
KafkaNotificationTest.testSendReceiveMessage fails when atlas-server is
running on the same machine
[ https://issues.apache.org/jira/browse/ATLAS-297?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hemanth Yamijala updated ATLAS-297:
-----------------------------------
Attachment: ATLAS-297.patch
The attached patch attempts to fix the issue using ephemeral ports.
Some details:
* The fix adds support for configuring an ephemeral port (value 0) for the ZooKeeper and Kafka servers in configuration.
* With ZooKeeper, we can just pass this on to the API and it automatically is picked up. Note that we can also fetch back the picked port using ServerCnxnFactory object to which we have a handle. The reason we need to get this back is so we can configure the port in the client (for e.g. when starting Kafka)
* For Kafka though, while we can pass it on, we don't seem to be able to fetch the picked port back through any Kafka API. Hence, in this case, I resorted to trying random ports for binding the server if the configuration specifies an ephemeral port. This is tried 3 times after which it fails. The number is hardcoded.
* Once fetched back, I update the config properties so that clients downstream which use the config get the bound port values.
* The ephemeral port range varies by platform - Linux and Windows (which I guess are important for us) have different port ranges. So, I used an overlapping set between the two, which I guess is large enough to work.
* I figured the properties file typesystem/src/main/resources/application.properties is from where the properties are picked up for this test. Changed this to have ephemeral values. Haven't changed it across the board though.
* The test now passes even when local atlas server is up. I also brought up atlas server with the fixed code and verified it works.
Please let me know what you feel about this fix.
> KafkaNotificationTest.testSendReceiveMessage fails when atlas-server is running on the same machine
> ----------------------------------------------------------------------------------------------------
>
> Key: ATLAS-297
> URL: https://issues.apache.org/jira/browse/ATLAS-297
> Project: Atlas
> Issue Type: Bug
> Environment: Dev environment
> Reporter: Hemanth Yamijala
> Assignee: Hemanth Yamijala
> Priority: Minor
> Attachments: ATLAS-297.patch
>
>
> Start the atlas-server on local machine. Then execute mvn -Dtest=KafkaNotificationTest -DfailIfNoTests=false test
> Get the following stack trace and test failure:
> Running org.apache.atlas.kafka.KafkaNotificationTest
> Tests run: 3, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 1.262 sec <<< FAILURE! - in org.apache.atlas.kafka.KafkaNotificationTest
> setUp(org.apache.atlas.kafka.KafkaNotificationTest) Time elapsed: 0.88 sec <<< FAILURE!
> org.apache.atlas.AtlasException: Failed to start embedded kafka
> at sun.nio.ch.Net.bind0(Native Method)
> at sun.nio.ch.Net.bind(Net.java:463)
> at sun.nio.ch.Net.bind(Net.java:455)
> at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
> at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
> at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67)
> at org.apache.zookeeper.server.NIOServerCnxnFactory.configure(NIOServerCnxnFactory.java:95)
> at org.apache.zookeeper.server.ServerCnxnFactory.createFactory(ServerCnxnFactory.java:126)
> at org.apache.atlas.kafka.KafkaNotification.startZk(KafkaNotification.java:140)
> at org.apache.atlas.kafka.KafkaNotification.start(KafkaNotification.java:170)
> at org.apache.atlas.kafka.KafkaNotificationTest.setUp(KafkaNotificationTest.java:40)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)