Skip to content

[BUG] InvalidOperationException: Trying to set an Activity that is not running. #501

@DFSko

Description

@DFSko

Describe the bug

A large number of InvalidOperationException exceptions are being thrown with the message: "Trying to set an Activity that is not running."

To Reproduce

Here's a MRE (Minimal Reproducible Example) of the issue:

  • Configure FusionCache with Backplane.
  • Set OpenTelemetry to use AlwaysOffSampler for sampling.
  • Observe the InvalidOperationException related to Activity not running.

Expected behavior

No InvalidOperationException errors related to Activity should occur when using the specified configuration.

Versions

I've encountered this issue on:

  • FusionCache version: 2.2.0
  • .NET version: 9.0
  • OS version: Ubuntu 24.04
  • Others: OpenTelemetry with AlwaysOffSampler

Screenshots

Image
Image

Additional context

The issue appears when configuring the Backplane with FusionCache and using OpenTelemetry with the AlwaysOffSampler. The exceptions are related to attempts to set an Activity that is not in a running state.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions