Skip to main content


 

Symptoms

 


You observe issues with escalation emails and email events in K2 environment integrated with Exchange Server. For example out of 10 emails sent about 5 not being delivered without any pattern in terms of destination address or something else. Whenever this sending failure happens there is nothing in K2 or email logs - no errors is being logged.
 

 

Diagnoses

 


Root cause of this issue can be related with EWSMaxConcurrency settings in Exchange Client Throttling policy. Steps to verify this:

You can decrease EWSMaxConcurrency to 1 (this means that max number of connections to EWS from specific account) for K2 service account, and next emulate mass email sending with escalation event - by starting processes in 7 threads with 0,5 seconds interval each of those fire escalation with email every 10 seconds. This should lead to bunch of escalations being sent almost at the same time with approximately the following results:

EWSMaxConcurrency = 1 75 emails sent by K2 – delivered 44 errors in IIS EWS log – 32
EWSMaxConcurrency = 10 15 emails sent – delivered 15
EWSMaxConcurrency = 20 45 emails sent – delivered 45

Based on this you can see that when doing mass sending of email K2 creates separate sessions maximum number of which = number of threads in K2 pool. If K2 performs mass email sending and EWSMaxConcurrency on email server lower than number of K2 threads mail sever start to drop these connections (applies throttling) and messages being sent by K2 essentially lost.

Unfortunately in 4.6.9-4.6.11 OOB K2 does not log failure of sending escalation message via EWS in scenario similar to one described above.

To verify EWS Throttling Policies being used it is possible to run the following commands using Exchange Management Shell:
Get-ThrottlingPolicyAssociation ""
and
Get-ThrottlingPolicy |fl

Using debug assemblies available upon request from K2 support it is possible to confirm that the following exception occurs whenever this problem happens:

Send email.Send exception: Microsoft.Exchange.WebServices.Data.ServerBusyException: The server cannot service this request right now. Try again later.

There is an existing coldfix for K2 4.6.9 which changes the retry logic to handle this exception where exception.ErrorCode == ErrCodeErrorServerBusy. This error happens when K2 sends a lot of emails at once from a workflow (EmailEvent or Escalations). With this coldfix when K2 gets ErrCodeErrorServerBusy K2 waits for a while and retry the call. This fix is planned for inclusion in 4.7 release.


 

 

Resolution

Verify if it is caused by EWSMaxConcurrency settings (see details above). You can either increase EWSMaxConcurrency setting or request a coldfix from K2 support. This issue should be addressed in upcoming 4.7 release.

 

 



 
Be the first to reply!

Reply