Troubleshooting 11205 Errors

Kmcnet 696 Reputation points
2022-07-21T22:38:29.207+00:00

Hello everyone and thanks for the help in advance. I have a web application that is an endpoint for Twilio phone api to make calls to. The endpoint makes three SQL database calls using EntityFramework Core. The server is running Windows Server 2022. The database calls are really not terribly intensive and I will be happy to post those, but am trying to start off simply. The calling application to my api has a timeout of 10 seconds which to me is inconceivable this is happening. But I need to start troubleshooting this problem and really don't know how to get started (that includes understanding IIS logs). Any help would be appreciated.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,188 questions
{count} votes

10 answers

Sort by: Most helpful
  1. Kmcnet 696 Reputation points
    2022-07-22T13:01:28.603+00:00

    Yes, the domain is registered and is reachable. In fact, the endpoint in question actually logs the incoming call to the database as expected, and triggers the expected business logic. The last portion of the code in the endpoint that returns a TwiML (basically xml response) is where the failure appears to be occurring.


  2. Kmcnet 696 Reputation points
    2022-07-26T12:22:33.73+00:00

    So I think I solved the problem but wasn't expecting the problem. It all came down to a simple database look performed in the controller. The lookup searched a database of approximately 30000 records for a match of the posted fields. This apparently was causing the controller to not respond quickly enough. I inadvertently wrote the lookup as synchronous rather than async. Once I changed this to async, the problem resolved. But I am now wondering why the lookup is causing such a bottleneck. The search uses EF Core 6.0.


  3. Kmcnet 696 Reputation points
    2022-07-26T13:43:41.597+00:00

    The search fields are definitely not indexed. I guess this now migrates to questions about index. This is currently the only application searching this table in this way. I did not implement indexing because the phone number being searched could appear in more than one record, i.e. not unique. Am I misunderstanding indexing concepts?


  4. AgaveJoe 26,136 Reputation points
    2022-07-26T16:50:47.667+00:00

    There no way to say it other than the design is really bad. The GetClientsByPhoneNumber can fail silently. If this method takes a long time to execute it could cause a race condition with other parts of the code. Is GetClientsByPhoneNumber a send and forget method?

    The LoginboundVoice() method could have the same issue as above. If there is any dependency between GetClientsByPhoneNumber() and LoginboundVoice() then you do have a race condition.

    The GetForwardingNumber() logic is unknown so I can't comment on the code. Nor can I comment on the Twilio specific logic.

    Lastly, you should be able to optimize the sp_GetCleintByPhoneNumber if the procedure is the actual bottleneck.

    Am I misunderstanding indexing concepts?

    I don't know what you know about indexes. Execute the stored procedure from SSMS to see how long it take to execute.


  5. AgaveJoe 26,136 Reputation points
    2022-07-26T18:43:46.287+00:00

    Let me bite off small pieces of this. First, do I have the async set up correctly that will allow both loginboundVoiceAsync and GetClientsByPhoneNumberAsync to run asynchronously and not block the execution of the next line of code?

    You code is like order pizza delivery put moving to a new location before the pizza guy arrives. There's no one home answer the door. Even worse it is unknown if the pizza was made or if the pizza guy showed up.

    The GetForwardingNumber() returns a query from a one row one column table that returns a default value in the event of query failure.

    There's no logical reason to execute the query since the the ID filter is hardcoded. Just store the number in configuration.

    GetClientsByPhoneNumber is as you say, a send and forget method that simply sends a text message to the forwarding phone.

    The way the code is designed, the original request context could be disposed while the GetClientsByPhoneNumber is executing. I believe you've created a race to complete before the object is torn down.

    I'm pretty sure you need to create a back ground task to make sure the logic completes.