There's no immediate way to abort a specific thread, however, have you tried to either:
- Stop or restart the element?
- If it isn't a production system, or the impact of reloading the data kept in scripting, you can kill the SLScripting process. It's one of the few processes that DataMiner will simply restart without restarting the agent.
- Your last option is to restart the agent if this thread really needs to get off the stack and killing SLScripting would be too abrupt.
You may want to stop the element while the agent is down to avoid it entering into the same state again, for that, we have the Change Element States Offline tool.
Do you require any assistance with the implementation of the async method?
With the help of Floris, this problem seems to have been solved.
At the moment everything looks OK, we will monitor the situation for a few more days.
The solution was to add a CancellationTokenSource with a TimeSpan of 30s and modify the async method call from:
var t = Task.Factory.StartNew(() => AsyncPump.Run(AsyncMethod, tokenSource.Token), tokenSource.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);