-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
Type of issue
- Bug
- Enhancement
- Compliance
- Question
- Help wanted
Current Behavior
I am running into thread pool starvation issues when publishing to a couple (~50) of MQTT topics.
Expected Behavior
Publishing to a larger amount of topics works without thread pool starvation / hiccups.
Steps To Reproduce
Here is a fork of the starter kit that reproduces the issue:
https://github.com/jnsjll/UA-IIoT-StarterKit
Environment
- OS: Windows 10
- Environment:
- Runtime: .NET 6
- Nuget Version:
- Component: PubSub
- Server:
- Client:Anything else?
The problem seems to be that the IntervalRunner used for each WriterGroupDataType / UaPublisher calls the PublishMessages method on a thread pool thread which will block on a lock in MqttPubSubConnection.PublishNetworkMessage:

Making the methods async and awaiting rather than blocking can resolve the issue.
Copilot