ReportUtilities hangs in .NET C# code

92 views
Skip to first unread message

PPC Developer

unread,
Jan 13, 2016, 3:45:56 PM1/13/16
to AdWords API Forum
Hi,


I saw another issue regarding this but the problem is still there for long running server scenarios. I'm pasting the code below, where the server is trying to download a report from AdWords in an infinite loop.


The below code is executed multiple times in a larger loop, it traverses all accounts, all campaigns, etc...It works, until it eventually hangs. No exceptions are thrown.


When I break into the code in Visual Studio, it's waiting for the highlighted line to execute. This call also doesn't time out.


Note that while it's undeterministic when it'll finally hang, but eventually it does. Your help is appreciated.


code below:


        int downloadAttempts = 1;
        while (true)
        {
            try
            {

                ReportUtilities utilities = new ReportUtilities(user, "v201506", definition);
                using (Google.Api.Ads.Common.Util.Reports.ReportResponse response = utilities.GetResponse())
                {
                    response.Save(saveFileName);
                    retval = new FileStream(saveFileName,FileMode.Open);
                }
                break;

            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                    errMessage = errMessage + ex.InnerException.Message;
                Console.WriteLine("Attempt:{0}. Failed to download report.{1}", downloadAttempts, errMessage);
                downloadAttempts++;
                // return retval;
                //                    throw new System.ApplicationException("Failed to download report.", ex);
            }
        }

PPC Developer

unread,
Jan 13, 2016, 4:08:04 PM1/13/16
to AdWords API Forum
Let me share one suspicion I have : This is an async call in the AdWords .NET Client, and when the internet connection is temporarily unavailable or there's some network issue, the asynch call never returns.

thx,
d.

Josh Radcliff (AdWords API Team)

unread,
Jan 14, 2016, 7:22:23 AM1/14/16
to AdWords API Forum
Hi,

I see that you posted this same message in a new issue on the .NET client library. The .NET client library owners will look into this and get back to you via comments on that issue.

Thanks,
Josh, AdWords API Team

PPC Developer

unread,
Jan 14, 2016, 3:48:38 PM1/14/16
to AdWords API Forum
ok Thanks.
Reply all
Reply to author
Forward
0 new messages