Grpc.Core.Server errors in my job output

Product: PowerShell Universal
Version: 4.2.13

Just today, I’m getting some additional output in my jobs when running them, I havent seen this before:

[information] W0303 17:16:29.750177 Grpc.Core.Server Exception while handling RPC. System.IO.IOException: Error sending status from server. 
[information]    at Grpc.Core.Internal.UnaryServerCallHandler`2.HandleCall(ServerRpcNew newRpc, CompletionQueueSafeHandle cq) 
[information]    at Grpc.Core.Server.HandleCallAsync(ServerRpcNew newRpc, CompletionQueueSafeHandle cq, Action`2 continuation) 

Does anyone know what might be causing this?
The job is pretty simple, it’s just making a few calls to SQL and completes successfully with some write-output before these messages, doesnt look to be impacted in anyway. I’ve tried rebooting the service but that doesnt clear this.
The only change I can think that I’ve made recently is switching from running the service as SYSTEM, to a service account.

Oddly only happening in one job from what I can tell.

To give more context on what the script/job is doing:
dot sourcing Invoke-SQLCmd2.ps1
Making 5 calls with that function, using Write-Output a couple of times, and doing some simple arithmetic which is fed into the write output.
Nothing fancy, and it’s common code that exists in my other scripts that don’t have this output

Just spotted the same output on a completely different script/job thats been running without this problem.

[information] W0304 19:09:20.985449 Grpc.Core.Server Exception while handling RPC. System.IO.IOException: Error sending status from server. 
[information]    at Grpc.Core.Internal.UnaryServerCallHandler`2.HandleCall(ServerRpcNew newRpc, CompletionQueueSafeHandle cq) 
[information]    at Grpc.Core.Server.HandleCallAsync(ServerRpcNew newRpc, CompletionQueueSafeHandle cq, Action`2 continuation) 

Is this a known bug? If not I’ll get it logged in github

Did you ever find a solution to that? We are getting similar errors, like:
W0418 14:14:00.865581 Grpc.Core.Server Exception while handling RPC. System.IO.IOException: Error sending status from server.

We get it seemingly randomly, we have a couple scripts chained and not too complicated stuff I guess.

Looks like adam dropped an update on my support ticket which i actually raised yesterday:

I have a fix in for the stuck canceling state. The server restart wasn’t resetting that state. That said, there seems to be some race condition we haven’t identified that is causing the perpetual running state. What appears to happen is the job runs to completion but fails to update the database with this case. It could also be part of the gRPC error you are seeing. Effectively, the gRPC process (pwsh.exe\powershell.exe) is shutting down before we finish a call like sending a log message or updating the state of the job.

I’m going to provide some more data for him, but hopefully this will be fixed in 4.2.19 by the above.