-
Notifications
You must be signed in to change notification settings - Fork 136
The minBytes and maxWait parameters in the fetch request are invalid #702
The minBytes and maxWait parameters in the fetch request are invalid #702
Conversation
d2b40e6
to
6f2bd64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add unit tests to verify this change. And you can run mvn checkstyle:check
and mvn spotbugs:check
to do the basic checks in your local env for code quality.
@BewareMyPower I added a unit test: io.streamnative.pulsar.handlers.kop.KafkaApisTest#testFetchMinBytes |
kafka-impl/src/main/java/io/streamnative/pulsar/handlers/kop/MessageFetchContext.java
Outdated
Show resolved
Hide resolved
kafka-impl/src/main/java/io/streamnative/pulsar/handlers/kop/DelayedFetch.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaApisTest.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaApisTest.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaApisTest.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaApisTest.java
Outdated
Show resolved
Hide resolved
I left some comments, PTAL. And I found the test failed, here's my debugging info in a single test:
It looks like even if the fetched bytes are enough, |
Are there any breakpoints during debugging? I ran the unit test locally, and this case did not appear. @BewareMyPower |
You can also see the CI result
|
In the ci log, I saw a fetch error log. It seemed that the address was not set, which caused the fetch to fail. Therefore, the data volume of the fetch was less than minBytes, resulting in a delay response, but the local environment operation did not report this problem, so I It is suspected to be related to the operating environment: |
|
We should not rely on the local test result. You can download the Artifacts from the Details page. We can see the logs under
And here's my local test: |
I use the kafkaconsumer API instead of calling handlefetchrequest directly to try to solve the problem! @BewareMyPower |
tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaApisTest.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaApisTest.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaApisTest.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaApisTest.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaApisTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
kafka-impl/src/main/java/io/streamnative/pulsar/handlers/kop/MessageFetchContext.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Good job!
fix : #699