Skip to content

PutIfAbsent with ForceReturnValue=true hangs indefinitely for non-existent keys #47

@ppetrovt

Description

@ppetrovt

When utilizing the PutIfAbsent method with the parameter ForceReturnValue set to true, an unexpected behavior occurs when the key doesn't exist. Specifically, the application hangs indefinitely instead of returning the expected result. It's noteworthy that the issue doesn't manifest when ForceReturnValue is set to false.

Upon further investigation, it's observed that even though the application appears to hang, subsequent restarts reveal that the value has indeed been added to the cache. However, the application fails to receive this result.

Expected Behavior:

The expected behavior of the PutIfAbsent method with ForceReturnValue set to true is to return the previous value associated with the key, which, in this scenario, should be null since the key doesn't exist prior to the operation.

Steps to Reproduce:

  1. Call the PutIfAbsent method with ForceReturnValue=true.
  2. Provide a key that doesn't exist in the cache.
  3. Observe that the application hangs indefinitely instead of returning the expected result.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions