kt icon indicating copy to clipboard operation
kt copied to clipboard

Non-zero exit code in case of warnings

Open mibollma opened this issue 1 year ago • 0 comments

I think it would be useful to return a non-zero exit code in case kt encountered a warning while reading data from topics either by default or only when enabled with an additional flag.

In my specific case while I am reading topic partition offsets I sometimes encounter warnings such as

failed to read info for topic ***. err=kafka server: In the middle of a leadership election, there is currently no leader for this partition and hence it is unavailable for writes. Source

In that case the topic is skipped and the data for this topic is missing in the result. If kt would return a non-zero exit code I could retry a few times with some delay until hopefully the leadership election is done.

@fgeller I can offer to give the implementation a shot if there is general interest to merge such a feature into master

mibollma avatar Jul 06 '23 08:07 mibollma