-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Queued Item marked invisible after idle time/redeploy of code. #1605
Comments
Further Info: Using Application Insights, I can see the host starting successfully, it detects the queued item, runs through all my code and outputs all the log statements all the way to the end of the function. Then this happens: An unhandled exception has occurred. Host is shutting down. Stack Trace logged by AppInsights:
I have a try..catch block around all my code with a logging statement to output any exceptions that my code causes but nothing gets output by it. Therefore it's something weird with the host? |
Thanks for the report @rndthoughts. Would you mind sharing:
|
Hi Brett, Thanks for responding.
Steve |
Thanks! I'll take your site info and try to see if I can find anything in our logs that looks suspect. If I think I need more info, we can try adding me to your VSTS repo. |
It's not clear where the ObjectDisposedExceptions are coming from -- would you be able to add me to your repo? You can find my work email in my Github profile. Is that all you need? |
I tried adding you to our VSTS git repo but as it's backed by Azure AD I can only add your account if it's a "Microsoft Account" - which ironically yours doesn't appear to be! Do you have an MS account I can add? If not, how else can I get a copy of the files to you securely? |
Try using my same email alias, but @outlook.com. Worst case, you could zip things up and email me to that microsoft email account. |
OK you should be able to get to the repo now: https://updateedge.visualstudio.com/_git/AzureFunctions I've just literally taken a copy of the project files from the solution and added them to a new repo for to look at. It doesnt compile in its current state as I havent fixed nuget, etc but the source code is identical. ClientApiUpdates is the function causing the problem. |
Thanks! I see it -- taking a look now. |
First thing I noticed -- your async function methods need to return a I'd also recommend switching the calls to I think that changing your return type to |
I can't believe I didn't spot I wasn't using Task! I have implemented the changes and redeployed. The log output seems to indicate that the function is firing twice for some reason? I have verified only one message is going into the queue. You can see below, we have duplicate output statements appearing with the same timestamps? The queued item has disappeared now though and is no longer hidden. UPDATE: I have tried this just after deployment and after queue idle and get the same result. 2017-06-26T08:32:07.356 Function started (Id=21b6c23e-b820-4ec5-8be2-270dacbb8e86) |
If you look at the Ids, it looks like you're seeing duplicate logs, not duplicate function invocations. Where are you seeing these logs? Was it in the portal, or on the file system itself? |
I was using Log file streaming on the portal. However, I just downloaded the .log file using FTP and I can see the same duplicate output in there too. I am using the textwriter object. It only seems to duplicate log on this function for some reason - my other ones don't. |
I've opened #1627 to track that as it's a separate issue. Besides the logging, is this now working as you'd expect? If so, I can close out this issue and investigate the logging duplications. |
Yes, thank you for your time and patience on this :) I haven't see any more instances of it marking messages hidden. Just for my sanity, do you think it's the lack of the Task keyword that was causing the issue? |
I've been trying to reproduce it and haven't been able to hit it, which makes me think there's some kind of race condition going on with your function when you don't return a I'm going to give it some more thought b/c I want to know exactly what's happening, but I'll close this issue since I think we've figured out how to get you running again. |
One more follow up -- how have you been publishing your changes? |
I use VSTS release to publish the code via webdeploy. |
Provide the steps required to reproduce the problem
Expected behavior
The queue message is processed and removed from the queue both when the queue busy and quiet.
Actual behavior
If the server backs off and idles, the message is hidden and processed 10-15 mins later. This also occurs when a new version of the underlying code is published. If i add another item to the queue it is processed correctly and removed while the hidden one is still present. When the hidden message reappears, it too is processed correctly and removed.
Known workarounds
Unknown
Other info
Logging and application insights show no exceptions or errors. The job restarts correctly when code changes are detected. I cannot find any log entries regarding the hiding of the initial message.
The text was updated successfully, but these errors were encountered: