2月11日更新
运行一个ASP.NET MVC网站。 在这个网站上,我们有一个页面有多个AJAX GET和一个用户发起的AJAX POST返回到我们的服务器。 对于一小部分用户(但数量可观),他们的POST得到 "err_connection_reset"。 这似乎是发生在多个浏览器上,而且似乎是最近才出现的现象。
然而,我们无法在内部用任何浏览器重复这种情况(使用全球各地的客户机)。 我们也有数以万计的用户,他们都能完美地工作。
我们很幸运,有一位用户能够从Chrome的开发者工具中向我们提供一些细节。
a - 控制台显示了一个POST错误,简单地说 "net::ERR_CONNECTION_RESET"。
b - 从记录的HAR文件中,我们可以看到这个事件的细节(一些数据用***替换)。
{
"startedDateTime": "2020-02-07T19:09:32.786Z",
"time": 0.06441399999312125,
"request": {
"method": "POST",
"url": "http://****.*********.***/************/************",
"httpVersion": "",
"headers": [
{
"name": "Host",
"value": "****.*********.***"
},
{
"name": "Connection",
"value": "keep-alive"
},
{
"name": "Content-Length",
"value": "864"
},
{
"name": "Accept",
"value": "*/*"
},
{
"name": "X-Requested-With",
"value": "XMLHttpRequest"
},
{
"name": "User-Agent",
"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36"
},
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Origin",
"value": "http://****.*********.***"
},
{
"name": "Referer",
"value": "http://****.*********.***/************?************"
},
{
"name": "Accept-Encoding",
"value": "gzip, deflate"
},
{
"name": "Accept-Language",
"value": "en-US,en;q=0.9"
},
{
"name": "Cookie",
"value": "************"
}
],
"queryString": [],
"cookies": [
{
"name": "************",
"value": "************",
"expires": null,
"httpOnly": true,
"secure": false
}
],
"headersSize": -1,
"bodySize": 864,
"postData": {
"mimeType": "application/json",
"text": "************"
}
},
"response": {
"status": 0,
"statusText": "",
"httpVersion": "",
"headers": [],
"cookies": [],
"content": {
"size": 0,
"mimeType": "x-unknown"
},
"redirectURL": "",
"headersSize": -1,
"bodySize": -1,
"_transferSize": 0,
"_error": "net::ERR_CONNECTION_RESET"
},
"cache": {},
"timings": {
"blocked": 0.06441399999312125,
"dns": -1,
"ssl": -1,
"connect": -1,
"send": 0,
"wait": 0,
"receive": 0,
"_blocked_queueing": -1
},
"serverIPAddress": "",
"_initiator": {
"type": "script",
"stack": {
"callFrames": [
{
"functionName": "send",
"scriptId": "301",
"url": "http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js",
"lineNumber": 1,
"columnNumber": 80265
},
{
"functionName": "ajax",
"scriptId": "301",
"url": "http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js",
"lineNumber": 1,
"columnNumber": 77117
},
{
"functionName": "n.ajax",
"scriptId": "303",
"url": "http://****.*********.***/bundles/************",
"lineNumber": 0,
"columnNumber": 2482
},
{
"functionName": "************.************",
"scriptId": "254",
"url": "http://****.*********.***/bundles/************",
"lineNumber": 0,
"columnNumber": 69415
},
{
"functionName": "************.************",
"scriptId": "254",
"url": "http://****.*********.***/bundles/************,
"lineNumber": 0,
"columnNumber": 67115
},
{
"functionName": "dispatch",
"scriptId": "301",
"url": "http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js",
"lineNumber": 1,
"columnNumber": 41771
},
{
"functionName": "y.handle",
"scriptId": "301",
"url": "http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js",
"lineNumber": 1,
"columnNumber": 39790
}
]
}
},
"_priority": "High",
"_resourceType": "xhr",
"pageref": "page_1"
}
从时间部分来看,这个调用似乎被阻止了大约64微秒(可能在其他AJAX调用之后),但它没有排队,也没有被发送。
我没有看到a)什么原因会导致这种情况,b)如何深入研究这个问题。 有什么建议吗?
更新:2月11日
在分析一个更大的HAR文件时,我可以看到它只影响到Content-Type为 "applicationjson "的POSTS。