lucasbru commented on PR #16941: URL: https://github.com/apache/kafka/pull/16941#issuecomment-2310032674
The method is internal and only indended for testing. I wouldn't add synchronization which in the end affects production code, where the synchronization isn't needed. The 'perfect' way is probably to try to rewrite the unit tests to get by without `currentTask`, but it will probably make the tests more convoluted. The one thing I would change is probaly remove it from the `TaskExecutor` interface and make it non-public, if possible. We also sometimes put `// intended for testing` next to the method, but not everybody likes it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org