Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TidSmtpServer Stops responding
#2
This seems to belong to the self inflicted injury type.

I have made 2 changes in my app that seem to have made a positive impact (although only in test for about an hour, where previously stability issues were occuring within that timeframe).

The addition of a try except block in my onConnect event

Code:
procedure TdSmtpServ.WwolSmtpServConnect(AContext: TIdContext);
var
 HostName              : string;
begin
 dmServiceSupport.SenderCS.Acquire;
 try
   inc(unique_id);
 finally
   dmServiceSupport.SenderCS.Release;
 end;
 try
   AContext.Connection.Socket.ReadTimeout := 15000;

   AContext.Data := TmySmtpItem.Create(unique_id, 'WwolSmtpServConnect', AContext.Binding.PeerIP, AContext.Binding.IP, AContext.Connection.ClassName, HostName);

   Log(now, 0, -4, AContext.Binding.IP, AContext.Binding.PeerIP, '[' + IntToStr(TmySmtpItem(AContext.Data).Id) + '] - ' + 'WwolSmtpServConnect',
     '[' + IntToStr(TmySmtpItem(AContext.Data).Id) + '] - ' +
     ' WwolSmtpServConnect connected at ' + DateTimeToStr(TmySmtpItem(AContext.Data).Start) +
     ' - ' + TmySmtpItem(AContext.Data).ThreadName +
     ' - SourceIP: ' + TmySmtpItem(AContext.Data).SourceIP +
     ' - DestIP: ' + TmySmtpItem(AContext.Data).DestIP +
     ' - ' + TmySmtpItem(AContext.Data).LastEvent);

 except
   on E: Exception do
   begin
     Log(now, 0, -4, AContext.Binding.IP, AContext.Binding.PeerIP, '[' + IntToStr(unique_id) + '] - ' + 'WwolSmtpServConnect EXCEPTION',
       '[' + IntToStr(unique_id) + '] - ' +
       ' - SourceIP: ' + AContext.Binding.PeerIP +
       ' - DestIP: ' + AContext.Binding.IP +
       ' - Connect EXCEPTION: ' + E.Message);
   end;
 end;
end;

and removed the 
TmySmtpItem(AThread.Data).LastEvent := 'WwolSmtpServListenException ' + AException.ClassName + ' - ' + AException.message;
statement from the onListenException event.

One or both of these appear to have made a positive impact.  I presume it must be the later as that impacts the Listener threads.

-Allen
Reply


Messages In This Thread
TidSmtpServer Stops responding - by bluewwol - 11-09-2018, 02:36 PM
RE: TidSmtpServer Stops responding - by bluewwol - 11-09-2018, 06:35 PM
RE: TidSmtpServer Stops responding - by rlebeau - 11-09-2018, 08:42 PM
RE: TidSmtpServer Stops responding - by bluewwol - 11-10-2018, 12:30 AM
RE: TidSmtpServer Stops responding - by rlebeau - 11-12-2018, 07:19 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)