[KAFKA-7379] [streams] send.buffer.bytes should be allowed to set -1 in KafkaStreams - #5643
Conversation
|
@mjsax review my changes, please. |
|
Hey @aai95 , I think we only wanted to change the bound on send and receive buffers. Also, can you think of some way to test this change? Thanks, |
5d5dde0 to
a3b0401
Compare
|
Hi @vvcephei, |
|
@aai95 For testing, we could add a test, but if Consumer/Producer would change the bounds, our test would not catch this anyway. Adding those parameters is basically code duplication. If we want to improve the code, Consumer/Producer (or mabye Thoughts? |
a3b0401 to
762b2d2
Compare
|
I performed rebase of my PR just to check that build passes. The test will be added. |
762b2d2 to
e609518
Compare
|
@mjsax review my changes, please. |
There was a problem hiding this comment.
@guozhangwang @hachikuji I think we can do this without a KIP, but I would like to very with you.
|
@aai95 could you add the unit test in |
e609518 to
ead236f
Compare
|
@guozhangwang review my changes, please. |
|
The jenkins failure is not relevant. |
mjsax
left a comment
There was a problem hiding this comment.
Just catching up on this PR -- couple of follow up comments -- maybe worth to do a follow up PR?
One more meta comment: why did we add the test in KafkaStreamsTest but not in StreamsConfigTest? Seems to be miss placed.
| props.put(CommonClientConfigs.SEND_BUFFER_CONFIG, Selectable.USE_DEFAULT_BUFFER_SIZE); | ||
| props.put(CommonClientConfigs.RECEIVE_BUFFER_CONFIG, Selectable.USE_DEFAULT_BUFFER_SIZE); | ||
| final KafkaStreams streams = new KafkaStreams(builder.build(), props); | ||
| streams.close(); |
There was a problem hiding this comment.
Just catching up on this PR. Should we wrap the close() into a finally block?
| } | ||
|
|
||
| @Test | ||
| public void testOsDefaultSocketBufferSizes() { |
There was a problem hiding this comment.
nit: naming -> shouldAcceptDefaultBufferSizes()
Also, I am wondering why we check for default buffer size? The ticket was about the issue, that -1 was not accepted. Thus, while having this test is ok, we should actually test for -1 to have a test that covers the reported issue.
| public void testInvalidSocketSendBufferSize() { | ||
| props.put(CommonClientConfigs.SEND_BUFFER_CONFIG, -2); | ||
| final KafkaStreams streams = new KafkaStreams(builder.build(), props); | ||
| streams.close(); |
There was a problem hiding this comment.
If new KafkaStreams throws, this line will never be executed (same below). Also, streams will not have any object assigned. Thus, we cannot even close anything, as the object was never created -- I think we can remove this line and also remove the variable streams.
| } | ||
|
|
||
| @Test(expected = KafkaException.class) | ||
| public void testInvalidSocketSendBufferSize() { |
There was a problem hiding this comment.
nit: -> shouldThrowForInvalidSocketSendBufferSize()
| } | ||
|
|
||
| @Test(expected = KafkaException.class) | ||
| public void testInvalidSocketReceiveBufferSize() { |
There was a problem hiding this comment.
nit: -> shouldThrowForInvalidSocketReceiveBufferSize()
…in KafkaStreams (apache#5643) What changes were proposed in this pull request? atLeast(0) in StreamsConfig, ProducerConfig and ConsumerConfig were replaced by SEND_BUFFER_LOWER_BOUND and RECEIVE_BUFFER_LOWER_BOUND from CommonClientConfigs. How was this patch tested? Three unit tests were added to KafkaStreamsTest Reviewers: Guozhang Wang <guozhang@confluent.io>, John Roesler <john@confluent.io>, Matthias J. Sax <mjsax@apache.org>
What changes were proposed in this pull request?
atLeast(0)inStreamsConfig,ProducerConfigandConsumerConfigwere replaced bySEND_BUFFER_LOWER_BOUNDandRECEIVE_BUFFER_LOWER_BOUNDfromCommonClientConfigs.How was this patch tested?
Three unit tests were added to
KafkaStreamsTestCommitter Checklist (excluded from commit message)