Hey, sorry for the late reply, I just have one minor suggestion. Since we don't make any guarantees about which thread gets removed or allow the user to specify, I think we should return either the index or full name of the thread that does get removed by removeThread().
I know you just updated the KIP to return true/false if there are/aren't any threads to be removed, but I think this would be more appropriate as an exception than as a return type. I think it's reasonable to expect users to have some sense to how many threads are remaining, and not try to remove a thread when there is none left. To me, that indicates something wrong with the user application code and should be treated as an exceptional case. I don't think the same code clarify argument applies here as to the addStreamThread() case, as there's no reason for an application to be looping and retrying removeStreamThread() since if that fails, it's because there are no threads left and thus it will continue to always fail. And if the user actually wants to shut down all threads, they should just close the whole application rather than call removeStreamThread() in a loop. While I generally think it should be straightforward for users to track how many stream threads they have running, maybe it would be nice to add a small utility method that does this for them. Something like // Returns the number of currently alive threads boolean runningStreamThreads(); On Thu, Sep 3, 2020 at 7:41 AM Matthias J. Sax <mj...@apache.org> wrote: > +1 (binding) > > On 9/3/20 6:16 AM, Bruno Cadonna wrote: > > Hi, > > > > I would like to start the voting on KIP-663 that proposes to add methods > > to the Kafka Streams client to add and remove stream threads during > > execution. > > > > > https://cwiki.apache.org/confluence/display/KAFKA/KIP-663%3A+API+to+Start+and+Shut+Down+Stream+Threads > > > > > > Best, > > Bruno > >