nodece opened a new pull request, #1501: URL: https://github.com/apache/pulsar-client-go/pull/1501
## Motivation Under timeout/reconnect races, the same sendRequest can hit done() more than once from different paths. Since done() clears and returns the object to sendRequestPool, a later duplicate call can access cleared fields and panic with nil pointer dereference. ## Modifications - Add an idempotency guard (doneFlag) in sendRequest.done() so duplicate invocations on the same instance return immediately. - Keep the guard raised after reset/put to block stale-pointer calls in the reset-to-reinit window. - Introduce newSendRequest(...) and newChunkSendRequest(...) helpers and route request creation through them, centralizing initialization for pooled objects. - Update tests to use constructor helpers where sendRequest is created in tests. - Add unit test TestSendRequestDoneIsIdempotentAfterPutToPool to verify a second done() call on the same pointer does not panic after pool return. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
