Replace the initial blocking connect in redisClusterAsyncConnect() with an ad hoc connect and slotmap update.
redisClusterAsyncConnect() only creates an asynchronous context with a prepared slot map containing configured nodes.
Since this API is called before any event system can be attached (which is needed for async) there is no immediate connection establishment performed. Users of this API is required to attach an event engine adapter to the returned cluster context and then any sent command will trigger the connection attempt. The prepared slot map will probably not match Redis view but Redis will make sure that hiredis-cluster's slotmap is updated via a MOVED redirect.
Before this change a blocking connect was setup during the API call and the slotmap was updated before returning.
Replace the initial blocking connect in
redisClusterAsyncConnect()
with an ad hoc connect and slotmap update.redisClusterAsyncConnect()
only creates an asynchronous context with a prepared slot map containing configured nodes.Since this API is called before any event system can be attached (which is needed for async) there is no immediate connection establishment performed. Users of this API is required to attach an event engine adapter to the returned cluster context and then any sent command will trigger the connection attempt. The prepared slot map will probably not match Redis view but Redis will make sure that hiredis-cluster's slotmap is updated via a MOVED redirect.
Before this change a blocking connect was setup during the API call and the slotmap was updated before returning.
Example usage of
redisClusterAsyncConnect()
: https://github.com/Nordix/hiredis-cluster/blob/1482d2147eed3e8b9774425491f0b1167d007644/tests/ct_async.c#L36C1-L51Seems to trigger new interesting heap-use-after-free in the ct_async_glib test only...