471,353 Members | 1,680 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,353 software developers and data experts.

Question on Program Hanging

Hi

I have a c# program that continually runs 24/7 and performs a variety of
tasks based on a timer.

There is one routine that hangs every Saturday morning without fail. If I
restart the program throughout the week is still hangs. I can restart it
immediatly after the hang and it runs fine until next Saturday.

There is nothing different about Saturday that I can think of.

Any help tracking this down would be appreciated!
Thanks

Robert

Here is the code snip:

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " Start Grab New
Invoices") ; // Simply writes out to a log file

ds = gds.GrabTheData("NewInvoices"); // ar_GetEmailInvoice01 - Puts data
into a dataset

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " End Grab New
Invoices") ;

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each");

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For each
Next");

// ****************************************** HANGS Here or

tempRowCount = ds.Tables[0].Rows.Count;

// ****************************************** HANGS Here

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Row Count " +
tempRowCount.ToString() ) ;

foreach (DataRow dr in ds.Tables[0].Rows)

{

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " Email the
Invoice") ;

CreateInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;

EmailInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;

gds.CustNum = dr["CustNum"].ToString() ;

gds.QuoteNum = dr["OrdNum"].ToString() ;

gds.UpdateTheData("InvoicesEmailed") ;

}

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " Exiting") ;


Jun 27 '08 #1
3 1518
On May 13, 12:22*pm, "Microsoft" <Robert12...@nospam.nospamwrote:
Hi

I have a c# program that continually runs 24/7 and performs a variety of
tasks based on a timer.

There is one routine that hangs every Saturday morning without fail. If I
restart the program throughout the week is still hangs. I can restart it
immediatly after the hang and it runs fine until next Saturday.
What error are you getting?
Check AppDomain.UnhandledException

Jun 27 '08 #2
Hi Robert,

As for such hang behavior problem, generally, if we can not get clear clus
from code logic, it will require some debugging work on it (such as find
the blocking thread and resource).

Not sure whether you've already read some about managed debugging on
application hang, here are some good blog article about managed debugging:

#.NET Debugging Demos Lab 1: Hang
http://blogs.msdn.com/tess/archive/2...mos-lab-1-hang
.aspx

#.NET Hang Debugging Walkthrough
http://blogs.msdn.com/tess/archive/2...ng-walkthrough
.aspx

BTW, as you provided the code snippet and the potential block point, how
did you originally track down to it? Also, it seems there are many method
calls on a custom class, has it accessed any particular resource or objects
that may cause problem?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: "Microsoft" <Ro*********@nospam.nospam>
Subject: Question on Program Hanging
Date: Tue, 13 May 2008 12:22:45 -0400
>Hi

I have a c# program that continually runs 24/7 and performs a variety of
tasks based on a timer.

There is one routine that hangs every Saturday morning without fail. If I
restart the program throughout the week is still hangs. I can restart it
immediatly after the hang and it runs fine until next Saturday.

There is nothing different about Saturday that I can think of.

Any help tracking this down would be appreciated!
Thanks

Robert

Here is the code snip:

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToS tring() + " Start Grab
New
>Invoices") ; // Simply writes out to a log file

ds = gds.GrabTheData("NewInvoices"); // ar_GetEmailInvoice01 - Puts data
into a dataset

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToS tring() + " End Grab New
Invoices") ;

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each");

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each
>Next");

// ****************************************** HANGS Here or

tempRowCount = ds.Tables[0].Rows.Count;

// ****************************************** HANGS Here

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Row Count "
+
>tempRowCount.ToString() ) ;

foreach (DataRow dr in ds.Tables[0].Rows)

{

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " Email the
Invoice") ;

CreateInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;

EmailInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;

gds.CustNum = dr["CustNum"].ToString() ;

gds.QuoteNum = dr["OrdNum"].ToString() ;

gds.UpdateTheData("InvoicesEmailed") ;

}

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToS tring() + " Exiting") ;


Jun 27 '08 #3
Hi Robert,

Have you got any progress on this issue or does those information help
some? Since such hanging or crash problem is likely to be hard for
troubleshooting, especially in production environment. If you still have no
luck on this and feel it an urgent issue, I would suggest you consider
contacting CSS for incident based support:

Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: st*****@online.microsoft.com (Steven Cheng [MSFT])
Organization: Microsoft
Date: Wed, 14 May 2008 04:55:02 GMT
Subject: RE: Question on Program Hanging
>
Hi Robert,

As for such hang behavior problem, generally, if we can not get clear clus
from code logic, it will require some debugging work on it (such as find
the blocking thread and resource).

Not sure whether you've already read some about managed debugging on
application hang, here are some good blog article about managed debugging:

#.NET Debugging Demos Lab 1: Hang
http://blogs.msdn.com/tess/archive/2...emos-lab-1-han
g
>.aspx

#.NET Hang Debugging Walkthrough
http://blogs.msdn.com/tess/archive/2...ing-walkthroug
h
>.aspx

BTW, as you provided the code snippet and the potential block point, how
did you originally track down to it? Also, it seems there are many method
calls on a custom class, has it accessed any particular resource or
objects
>that may cause problem?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ault.aspx#noti
f
>ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================= =
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>>From: "Microsoft" <Ro*********@nospam.nospam>
Subject: Question on Program Hanging
Date: Tue, 13 May 2008 12:22:45 -0400
>>Hi

I have a c# program that continually runs 24/7 and performs a variety of
tasks based on a timer.

There is one routine that hangs every Saturday morning without fail. If I
restart the program throughout the week is still hangs. I can restart it
immediatly after the hang and it runs fine until next Saturday.

There is nothing different about Saturday that I can think of.

Any help tracking this down would be appreciated!
Thanks

Robert

Here is the code snip:

af.AddToFile(Constants.c_LogFile,DateTime.Now.To String() + " Start Grab
New
>>Invoices") ; // Simply writes out to a log file

ds = gds.GrabTheData("NewInvoices"); // ar_GetEmailInvoice01 - Puts data
into a dataset

af.AddToFile(Constants.c_LogFile,DateTime.Now.To String() + " End Grab New
Invoices") ;

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each");

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each
>>Next");

// ****************************************** HANGS Here or

tempRowCount = ds.Tables[0].Rows.Count;

// ****************************************** HANGS Here

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Row Count "
+
>>tempRowCount.ToString() ) ;

foreach (DataRow dr in ds.Tables[0].Rows)

{

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " Email the
Invoice") ;

CreateInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;

EmailInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;

gds.CustNum = dr["CustNum"].ToString() ;

gds.QuoteNum = dr["OrdNum"].ToString() ;

gds.UpdateTheData("InvoicesEmailed") ;

}

af.AddToFile(Constants.c_LogFile,DateTime.Now.To String() + " Exiting") ;



Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by briforge | last post: by
2 posts views Thread by Arben Qarkaxhija | last post: by
10 posts views Thread by feel52 | last post: by
4 posts views Thread by jdc_1040 | last post: by
reply views Thread by Materialised | last post: by
1 post views Thread by =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?= | last post: by
kreagan
1 post views Thread by kreagan | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.