...
Kafka consumer methods that need to be protected against multi-threaded access start with invoking private method acquire
and end with invoking private method release
. This KIP does not change that. The changes the implementation of acquire
and release
does change.
When acquire
is invoked, we first check if access is restricted. It is restricted when the access-key stack is not empty. If it is not empty, the thread-local variable must be equal to the value on the top of the stack. If it is empty, any thread may continue. After this check, we generate a new access-key that can be used inside callbacks. This new access key is pushed on the stack and also stored in the thread-local variable.
...