Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Api call connection resets

Api call connection resets

Scheduled Pinned Locked Moved ASP.NET
dotnetcsharpasp-netwindows-adminai-coding
3 Posts 2 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fred2834
    wrote on last edited by
    #1

    Hello, In an ASP .Net Core 8 API, we have an issue with the processing of a call that lasts longer than 2 minutes. It lasts long because we have to parse a ton of files (call can be 5-6 minutes), we know this should be improved, but that's beside the point here. In a previous version of this API (.Net Framework 4.8), this call used to last just as long, and the API did not reset the connection. In the .Net 8 version, we get such a message : Connection id "xxx" reset. Connection id "xxx" sending FIN because: "The Socket transport's send loop completed gracefully." Connection id "xxx" disconnecting. After some googling and copilot'ing, we found that this seems related to Kestrel configuration, so we tried several things: - serverOptions.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(5); - Changed a few parameters related to timeouts in IIS - Changed the timeout parameter from the client app calling the API .. but nothing works. Does anyone have experience with this ? It's clear that the timeout duration has to be adjusted somewhere, but we have no idea where to look. Thanks in advance :)

    F 1 Reply Last reply
    0
    • F Fred2834

      Hello, In an ASP .Net Core 8 API, we have an issue with the processing of a call that lasts longer than 2 minutes. It lasts long because we have to parse a ton of files (call can be 5-6 minutes), we know this should be improved, but that's beside the point here. In a previous version of this API (.Net Framework 4.8), this call used to last just as long, and the API did not reset the connection. In the .Net 8 version, we get such a message : Connection id "xxx" reset. Connection id "xxx" sending FIN because: "The Socket transport's send loop completed gracefully." Connection id "xxx" disconnecting. After some googling and copilot'ing, we found that this seems related to Kestrel configuration, so we tried several things: - serverOptions.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(5); - Changed a few parameters related to timeouts in IIS - Changed the timeout parameter from the client app calling the API .. but nothing works. Does anyone have experience with this ? It's clear that the timeout duration has to be adjusted somewhere, but we have no idea where to look. Thanks in advance :)

      F Offline
      F Offline
      Fred2834
      wrote on last edited by
      #2

      Ok, so problem solved, my colleague found the parameter that controls this, here's the info, hopefully it will help someone! In the web.config, you can set the parameter requestTimeout to the value you want, as in :

      Alternatively you can also set this parameter via the Configuration Editor in IIS.

      N 1 Reply Last reply
      0
      • F Fred2834

        Ok, so problem solved, my colleague found the parameter that controls this, here's the info, hopefully it will help someone! In the web.config, you can set the parameter requestTimeout to the value you want, as in :

        Alternatively you can also set this parameter via the Configuration Editor in IIS.

        N Offline
        N Offline
        Nitin S
        wrote on last edited by
        #3

        you will get the same error if your request runs more than `00:05:00`, maybe you can run the long running task in background task/thread (hangfire maybe) and then keep on reading the status from another api method.

        ===================================================== The grass is always greener on the other side of the fence

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups