✅ Can this produce an DeadLock?
Im not sure in combination with linq an dead lock can occur. But this runs in an Azure Function, and it just stopped working. No crashes, it timeout after 6 hours. No further logs

49 Replies
Looks fine to me. Did you try to recreate the conditions before the timeout?
this article outlines some practices for implementing logging that helps you recreate program state after the fact. Maybe it can help you if this issue reoccurs.
Repeatable execution
What to log, and how to log it.
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
Where?
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
no
It returns
Task<T>
it's a select, it cannot be voidUnknown User•2w ago
Message Not Public
Sign In & Join Server To View
No, it's a
Select<TInput, Task<TOutput>>(Func<TInput, Task<TOutput>> selector)
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
There is no async void here. It returns a
Task<StockInfoResponse[]>
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
Sleep is right, it's not an async void

that's also the behaviour i want, if a request fails, the rest can crash and burn, there a polly retry in there
Yeah, I don't really see how this can silently fail.
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
Have you read the OP?
Parallel.ForEachAsync isnt a thing either on functions right?
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
i mean functions is not nice with threads
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
just a isolated worker, not durable?
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
it stops logging traces all together to app insights
maybe verbocity is a good idea
but g2g ill look later again
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
Why on earth wouldn't you do that?
Severe skill issue here 🙂 The consumer of a method doesn't care whether it's
async
or not. Only whether it returns a Task
or not. It doesn't matter whether that Task
is being returned from another method, or created by the async machineryUnknown User•2w ago
Message Not Public
Sign In & Join Server To View
Nope its not durable, was just making sure we were talking about the same thing
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
i was able to reproduce it locally, with adding logs everywhere i was able to narrow it down to a line a code. Honestly i can't explain the error. But the main issue is Azure Function seem to throw an error silently, and doesnt kill the app it just hangs
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
it is indeed unrelated to the code i gave above
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
so the code above gathers stock info of products right, then we use that stock info to remove products of a favorite lists. It might be hard to believe but the error happend on line 21, when i added logs everywhere around that code that's where it got stuck. Now in DeleteitemRequest i added .ToList() to favorites before creating it and that solved the issue. I never got an error thrown or stacktrace. It doesnt happen in my testcontainers. favoriteRepository is a cosmos db

Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
it never reached line 26, so it never reached cosmos
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
yes
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
Favolist is an object directly from cosmos
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
there's a toList earlier in the call too but only for ids

yea but still the issue is it's throwing something and the function doesnt bubble it up
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
This is the issue. There isnt one, it just breaks and hangs. I'd like to see the error too
I only found the line due to adding logs everywhere, so now your guess is as good as mine
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
im still puzzled that i ran into this and there's not github issue for it. I can't be the first with a silent crash?
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View