MINOR: Prohibit setting StreamsConfig commit.interval.ms to a negative value#5809
MINOR: Prohibit setting StreamsConfig commit.interval.ms to a negative value#5809mjsax merged 4 commits intoapache:trunkfrom occho:streams-prohibit-negative-commit-interval
Conversation
|
We might be able to remove the check |
|
@guozhangwang Could you review this? |
|
It's a judgement call. I am fine with the change. We recently updated @occho I think it's save the remove the check |
Sure. Thank you for your advice. |
bbejeck
left a comment
There was a problem hiding this comment.
Overall looks good to me. I think we should have some unit tests demonstrating the fix i.e an Exception results when trying to set commit.interval.ms to a negative value
|
Added a test. |
|
Ah, wait, I need more fix. |
|
Updated and rebased onto the latest trunk. |
There was a problem hiding this comment.
nit: maybe keep this test but pass in 0 instead?
There was a problem hiding this comment.
From my understanding, the test name is wrong and should be like shouldNotFlushWhenFlushIntervalIsNegative.
The code that shouldNotFlushWhenFlushIntervalIsZero tests is about this line:
With the code on trunk, when flushInterval is set to negative, stateMaintainer.flushState() is not called.
But, since this spec is removed, I think it is okay to remove the test.
WDYT?
There was a problem hiding this comment.
Ack, thanks for the explanation. Sounds good to me.
|
retest this please |
|
Thank you for reviewing. :) |
…e value (apache#5809) Reviewers: Guozhang Wang <guozhang@confluent.io>, Matthias J. Sax <matthias@confluent.io>, Bill Bejeck <bill@confluent.io>
Prohibit setting StreamsConfig
commit.interval.msto a negative value to avoid possible ambiguity of what it indicates.So far, setting the property to a negative value can be used to turn off periodic offset-commit by
StreamThread. With this change, that will no longer work.Instead of using a negative value,
LONG.MAX_VALUEcan be used to achieve the almost same thing.Committer Checklist (excluded from commit message)