Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-7312: Change broker port used in testMinimumRequestTimeouts and testForceClose #6360

Closed
wants to merge 5 commits into from

Conversation

omkreddy
Copy link
Contributor

@omkreddy omkreddy commented Mar 3, 2019

Port 22 is used by ssh, which causes the AdminClient to throw an OOM:

java.lang.OutOfMemoryError: Java heap space
at java.nio.HeapByteBuffer.(HeapByteBuffer.java:57)
at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
at org.apache.kafka.common.memory.MemoryPool$1.tryAllocate(MemoryPool.java:30)
at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:112)
at org.apache.kafka.common.network.KafkaChannel.receive(KafkaChannel.java:424)
at org.apache.kafka.common.network.KafkaChannel.read(KafkaChannel.java:385)
at org.apache.kafka.common.network.Selector.attemptRead(Selector.java:640)
at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:561)
at org.apache.kafka.common.network.Selector.poll(Selector.java:472)
at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:535)
at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1140)
at java.lang.Thread.run(Thread.java:748)

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@@ -1062,7 +1062,7 @@ class AdminClientIntegrationTest extends IntegrationTestHarness with Logging {
@Test
def testMinimumRequestTimeouts(): Unit = {
val config = createConfig()
config.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:22")
Copy link
Contributor Author

@omkreddy omkreddy Mar 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ijuma Is there any specific reason for using port 22 (default SSH port) here? Due to this, some times the test is failing with out of memory .

java.lang.OutOfMemoryError: Java heap space
	at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
	at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
	at org.apache.kafka.common.memory.MemoryPool$1.tryAllocate(MemoryPool.java:30)
	at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:112)
	at org.apache.kafka.common.network.KafkaChannel.receive(KafkaChannel.java:424)
	at org.apache.kafka.common.network.KafkaChannel.read(KafkaChannel.java:385)
	at org.apache.kafka.common.network.Selector.attemptRead(Selector.java:640)
	at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:561)
	at org.apache.kafka.common.network.Selector.poll(Selector.java:472)
	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:535)
	at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1140)
	at java.lang.Thread.run(Thread.java:748)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird, I don't know why that was chosen. Good find!

@omkreddy omkreddy requested a review from ijuma March 3, 2019 07:39
@omkreddy omkreddy changed the title KAFKA-7312: Change the broker port in AdminClientIntegrationTest (testMinimumRequestTimeouts, testForceClose) tests KAFKA-7312: Change the broker port used in AdminClientIntegrationTest (testMinimumRequestTimeouts, testForceClose) tests Mar 3, 2019
Copy link
Contributor

@ijuma ijuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have a constant for incorrect port and reuse it. Have we verified the 222 is not used by anything?

…tMinimumRequestTimeouts, testForceClose) tests
@omkreddy
Copy link
Contributor Author

omkreddy commented Mar 3, 2019

@ijuma I have used port 225 as incorrect broker port. port 225 is a reserved port. Pls take a look.

@omkreddy
Copy link
Contributor Author

omkreddy commented Mar 4, 2019

retest this please

@@ -71,6 +71,9 @@ object TestUtils extends Logging {
/* 0 gives a random port; you can then retrieve the assigned port from the Socket object. */
val RandomPort = 0

/* Incorrect broker port which can used by kafka clients in tests. */
val incorrectBrokerPort = 225
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add something like: "this port should not be used by any other service and hence we use a reserved port"

@ijuma ijuma changed the title KAFKA-7312: Change the broker port used in AdminClientIntegrationTest (testMinimumRequestTimeouts, testForceClose) tests KAFKA-7312: Change broker port used in testMinimumRequestTimeouts and testForceClose Mar 4, 2019
Copy link
Contributor

@ijuma ijuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a couple of minor changes to fix the naming convention of IncorrectBrokerPort. LGTM now.

@ijuma ijuma added the tests Test fixes (including flaky tests) label Mar 4, 2019
@omkreddy
Copy link
Contributor Author

omkreddy commented Mar 4, 2019

retest this please

@omkreddy omkreddy closed this in 9ee5f92 Mar 4, 2019
omkreddy added a commit that referenced this pull request Mar 4, 2019
… testForceClose

Port 22 is used by ssh, which causes the AdminClient to throw an OOM:

> java.lang.OutOfMemoryError: Java heap space
> 	at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
> 	at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
> 	at org.apache.kafka.common.memory.MemoryPool$1.tryAllocate(MemoryPool.java:30)
> 	at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:112)
> 	at org.apache.kafka.common.network.KafkaChannel.receive(KafkaChannel.java:424)
> 	at org.apache.kafka.common.network.KafkaChannel.read(KafkaChannel.java:385)
> 	at org.apache.kafka.common.network.Selector.attemptRead(Selector.java:640)
> 	at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:561)
> 	at org.apache.kafka.common.network.Selector.poll(Selector.java:472)
> 	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:535)
> 	at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1140)
> 	at java.lang.Thread.run(Thread.java:748)
>
>

Author: Manikumar Reddy <manikumar.reddy@gmail.com>
Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #6360 from omkreddy/KAFKA-7312

(cherry picked from commit 9ee5f92)
Signed-off-by: Manikumar Reddy <manikumar@confluent.io>
omkreddy added a commit that referenced this pull request Mar 4, 2019
… testForceClose

Port 22 is used by ssh, which causes the AdminClient to throw an OOM:

> java.lang.OutOfMemoryError: Java heap space
> 	at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
> 	at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
> 	at org.apache.kafka.common.memory.MemoryPool$1.tryAllocate(MemoryPool.java:30)
> 	at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:112)
> 	at org.apache.kafka.common.network.KafkaChannel.receive(KafkaChannel.java:424)
> 	at org.apache.kafka.common.network.KafkaChannel.read(KafkaChannel.java:385)
> 	at org.apache.kafka.common.network.Selector.attemptRead(Selector.java:640)
> 	at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:561)
> 	at org.apache.kafka.common.network.Selector.poll(Selector.java:472)
> 	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:535)
> 	at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1140)
> 	at java.lang.Thread.run(Thread.java:748)
>
>

Author: Manikumar Reddy <manikumar.reddy@gmail.com>
Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #6360 from omkreddy/KAFKA-7312

(cherry picked from commit 9ee5f92)
Signed-off-by: Manikumar Reddy <manikumar@confluent.io>
omkreddy added a commit that referenced this pull request Mar 4, 2019
… testForceClose

Port 22 is used by ssh, which causes the AdminClient to throw an OOM:

> java.lang.OutOfMemoryError: Java heap space
> 	at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
> 	at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
> 	at org.apache.kafka.common.memory.MemoryPool$1.tryAllocate(MemoryPool.java:30)
> 	at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:112)
> 	at org.apache.kafka.common.network.KafkaChannel.receive(KafkaChannel.java:424)
> 	at org.apache.kafka.common.network.KafkaChannel.read(KafkaChannel.java:385)
> 	at org.apache.kafka.common.network.Selector.attemptRead(Selector.java:640)
> 	at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:561)
> 	at org.apache.kafka.common.network.Selector.poll(Selector.java:472)
> 	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:535)
> 	at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1140)
> 	at java.lang.Thread.run(Thread.java:748)
>
>

Author: Manikumar Reddy <manikumar.reddy@gmail.com>
Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #6360 from omkreddy/KAFKA-7312

(cherry picked from commit 9ee5f92)
Signed-off-by: Manikumar Reddy <manikumar@confluent.io>
@omkreddy omkreddy deleted the KAFKA-7312 branch March 5, 2019 04:17
pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
… testForceClose

Port 22 is used by ssh, which causes the AdminClient to throw an OOM:

> java.lang.OutOfMemoryError: Java heap space
> 	at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
> 	at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
> 	at org.apache.kafka.common.memory.MemoryPool$1.tryAllocate(MemoryPool.java:30)
> 	at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:112)
> 	at org.apache.kafka.common.network.KafkaChannel.receive(KafkaChannel.java:424)
> 	at org.apache.kafka.common.network.KafkaChannel.read(KafkaChannel.java:385)
> 	at org.apache.kafka.common.network.Selector.attemptRead(Selector.java:640)
> 	at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:561)
> 	at org.apache.kafka.common.network.Selector.poll(Selector.java:472)
> 	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:535)
> 	at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1140)
> 	at java.lang.Thread.run(Thread.java:748)
>
>

Author: Manikumar Reddy <manikumar.reddy@gmail.com>
Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes apache#6360 from omkreddy/KAFKA-7312
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Test fixes (including flaky tests)
Projects
None yet
2 participants