Fixed issue #173: Thread safety issue for getIndexConnection()
and getAsyncIndexConnection()
The getIndexConnection()
and getAsyncIndexConnection()
methods were not thread-safe. The underlying connectionsMap
, which maintains a mapping of index names (String
) to their corresponding PineconeConnection
instances, was incorrectly updating all entries to reference the most recently created connection. This fix ensures that each index maintains its own distinct connection, preventing unintended overwrites in multi-threaded environments.
What's Changed
- Create new config per connection by @rohanshah18 in #178
- Prepare to release v4.0.1 by @rohanshah18 in #179
Full Changelog: v4.0.0...v4.0.1