Details
-
Bug
-
Resolution: Fixed
-
Major
-
2.5.0, 2.5.1
-
None
-
None
Description
NCBC-1206 allows per-operation timeouts to be specified.
However, as part of this change, the code for dictionary-based multi upserts incorrectly sets the timeout value as the expiration value instead:
public IDictionary<string, IOperationResult<T>> Upsert<T>(IDictionary<string, T> items, TimeSpan timeout)
|
{
|
CheckDisposed();
|
var results = new ConcurrentDictionary<string, IOperationResult<T>>();
|
if (items != null && items.Count > 0)
|
{
|
var keys = items.Keys.ToList();
|
var partitionar = Partitioner.Create(0, items.Count());
|
Parallel.ForEach(partitionar, (range, loopstate) =>
|
{
|
for (var i = range.Item1; i < range.Item2; i++)
|
{
|
var key = keys[i];
|
var value = items[key];
|
var result = Upsert(key, value, timeout);
|
results.TryAdd(key, result);
|
}
|
});
|
}
|
return results;
|
}
|
Which maps to the method signature:
public IOperationResult<T> Upsert<T>(string key, T value, TimeSpan expiration)
|
{
|
return Upsert(key, value, expiration.ToTtl());
|
}
|
Instead it needs to use the method which accepts an expiration (which has to be 0 anyway) AND a timeout.