dotnet / dotnet/dotnet-api-docs

NullTargetBlock never Completes

Open
#7,864 7 comments 1 reaction 0 assignees View on GitHub
area-System.Threading.Tasks help wanted Pri3
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

### Description

When ```Complete()``` is called on a ```NullTargetBlock```, the block should transition to the Completed state allowing items that are waiting on its ```.Completion``` to continue.

Instead, ```.Completion``` never completes and the application just hangs.

### Reproduction Steps

Console.WriteLine("Started!");

var Block = System.Threading.Tasks.Dataflow.DataflowBlock.NullTarget();
Block.Complete();

await Block.Completion;

Console.WriteLine("Complete!");

### Expected behavior

```.Completion``` actually completes

### Actual behavior

```.Completion``` never completes

### Regression?

Not sure.

### Known Workarounds

None known.

### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.