【发布时间】:2017-07-07 04:42:49
【问题描述】:
这个问题是在你必须在 loadrunner 中使用 WinInet 重放引擎的时候提出的。当响应时间超过 30 秒时,会观察到超时错误。默认情况下,wininet 将超时设置为 30 秒。有一种方法可以让它重试请求,但在我的情况下,它是一个发布请求,重试不是一个现实的情况。 遇到的错误是 -
Error -27492: "HttpSendRequest" failed, Windows error code=12002 and retry limit (0) exceeded for URL="https
RTS 截图:
有没有办法将超时配置为更高的值以及在哪里设置?
LR12.53,Windows 服务器 2008
新信息
为了演示上述行为,我创建了一个 Web 应用程序,它需要 30 多秒才能响应 GET 请求。我还在 Loadrunner 的运行时设置中启用了 WinInet 重放,如上图所示。
脚本的动作
Action()
{
lr_start_transaction("slow_transaction");
web_custom_request("slow_transaction",
"URL=http://localhost:8887/slow_response",
"Method=GET",
"TargetFrame=",
"Resource=0",
"Referer=",
"Mode=HTML",
"Body=",
LAST);
lr_end_transaction("slow_transaction", LR_AUTO);
return 0;
}
在使用高级跟踪执行上述脚本时,我可以看到以下日志。观察到的错误是Action.c(6): Error -27492: "HttpSendRequest" failed, Windows error code=12002 and retry limit (0) exceeded for URL="http://localhost:8887/slow_response" [MsgId: MERR-27492]
Action.c(4): Notify: Transaction "slow_transaction" started.
Action.c(6): web_custom_request("slow_transaction") started [MsgId: MMSG-26355]
Action.c(6): DETECTING_PROXY" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): RESOLVING_NAME" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): NAME_RESOLVED" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): CONNECTING_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): CONNECTING_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): CONNECTED_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): SENDING_REQUEST" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): REQUEST_SENT" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): RECEIVING_RESPONSE" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): CLOSING_CONNECTION" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): CONNECTION_CLOSED" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): REQUEST_COMPLETE" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): Error -27492: "HttpSendRequest" failed, Windows error code=12002 and retry limit (0) exceeded for URL="http://localhost:8887/slow_response" [MsgId: MERR-27492]
Action.c(6): HANDLE_CLOSING" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(6): web_custom_request("slow_transaction") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388]
Action.c(6): Notify: Transaction "slow_transaction" ended with a "Fail" status (Duration: 31.1355 Wasted Time: 0.1075).
现在在脚本中使用web_set_max_retries("2"); 设置重试时,我们可以在日志中清楚地看到它在响应未到达的某个时间后重试,但这也会失败,因为它是一个新请求,并且会再次花费更多时间超过 30 秒 ;)
重试日志:
Action.c(7): CLOSING_CONNECTION" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(7): CONNECTION_CLOSED" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(7): REQUEST_COMPLETE" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(7): Attempting "HttpSendRequest" retry due to Windows error code=12002 for URL="http://localhost:8887/slow_response" [MsgId: MMSG-27491]
Action.c(7): DETECTING_PROXY" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(7): CONNECTING_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
Action.c(7): CONNECTED_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response" [MsgId: MMSG-27397]
现在我们有证据表明 WinInet 在大约 30 秒后重试。我能否请惠普支持或其他 LR 专家、WinInet 专家建议是否有办法增加 WinInet 中的超时以及如何增加?
【问题讨论】:
-
请说明您如何知道这是一个需要重试的 Windows 集成身份和安全问题
-
嗨詹姆斯,我不希望它重试请求,希望它等待更多时间(同步)。这是因为我的一些应用程序需要超过 30 秒(它被接受)才能响应,在这种情况下,LRs 默认播放(套接字)不起作用。一直在观察其他问题。那是完全不同的问题。所以简单地说,需要一种方法来增加 WinInet 默认超时,即 30 秒。
-
标准 HTTP 超时为 120 秒。这意味着在该窗口内不会返回一个字节。您确定您没有查看与响应超时不同的连接超时吗?
-
大家好,我在使用 wininet 重放引擎时添加了 lr 超时的新信息和证据。请再次阅读问题。
-
你在本地主机上。您不应该使用代理进行连接
标签: loadrunner wininet