This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unknown exception caused by thread safety issue (#2033)
### Motivation Both the response thread and timeout detection thread will access PendingProduceCallback This problem will easily occur when the sending latency is close to the timeout threshold. Step-1: response thread and timeout detection thread access 1 at the same time, none of them meet the conditions for return Step-2: timeout detection thread execute to 2, and set responseMap = null Setp-3: response thread execute to 3, cause NPE <img width="864" alt="image" src="https://github.com/streamnative/kop/assets/9758905/96a1a8f5-cf09-4bcd-8f4a-24f9c8205474"> ### Modifications Add synchronized
- Loading branch information