long-polling


How to combine async and blocking requests in VuGen?


I'm working on a load test for my long-poll chat-like service. The use case I want to test is fairly simple:
Open a long-poll GET connection
Send a message using POST request
Assert that connection opened in step 1 has received the same message
I managed to implement steps 1 and 2 (and I can see in server access logs that requests are made) but on step 3 I'm getting following error:
Error -27653: Attempted read from an unconnected socket ("Connection:
close" specified but server-side closure not detected).
URL="https://{Env}/chat/poll/" [MsgId: MERR-27653]
Warning -27764: Request "https://{Env}/chat/poll/" failed [issued at Action.c(76)]
[MsgId: MWAR-27764]
Can I combine async requests with blocking requests?
My test code is
int done;
Action()
{
int HttpRetCode;
int i = 5;
// Initialize the global done state variable, and start the async transaction variable
done = 0;
lr_start_transaction("async-call");
// Define the request to be handled asynchronously
// Specify the callback functions that will be called when the response is returned.
// The callback functions are defined below.
web_reg_async_attributes("ID=Poll_0",
"URL=https://{Env}/chat/poll/",
"Pattern=LongPoll",
"PollIntervalMs=200",
"RequestCB=Poll_0_RequestCB",
"ResponseBodyBufferCB=Poll_0_ResponseBodyBufferCB",
"ResponseCB=Poll_0_ResponseCB",
LAST);
// now make the async call.
// note that the script will not block on this call. processing will continue on past this step while the request is handles asynchronously
web_url("Poll_0",
"URL=https://{Env}/chat/poll/",
"Resource=1",
LAST);
lr_force_think_time(10);
// Send interop message
lr_message("Send interop message");
lr_start_transaction("/chat/.POST.201");
web_add_header("X-Session-ID", "sessionA");
web_custom_request("Push interop message",
"URL=https://{Env}/chat/",
"Method=POST",
"Resource=0",
"Mode=HTTP",
"Body=DJIGURDA",
LAST);
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if (HttpRetCode != 201) {
lr_error_message("Unexpected return code: %d", HttpRetCode);
lr_end_transaction("/chat/.POST.201", LR_FAIL);
} else {ev
lr_end_transaction("/chat/.POST.201", LR_AUTO);
}
lr_message("Waiting for response");
// To capture the response time of the async call, wait until the callback is called.
// Without this, the script would move past and complete the iteration before the callback is called.
//web_sync("ParamCreated=ready","RetryIntervalMs=18000","RetryTimeoutMs=3600000",LAST);
// To capture the response time of the async call, wait until the callback is called.
// Without this, the script would move past and complete the iteration before the callback is called.
while (done==0 && i-- > 0)
{
lr_force_think_time(1);
}
// once the callback has been called, end the transaction to get the response time.
lr_end_transaction("async-call", LR_AUTO);
// stop the polling
web_stop_async("ID=Poll_0",
LAST);
return 0;
}
/*
* Callback Implementation
*
*
*/
int Poll_0_RequestCB()
{
//enter your implementation for RequestCB() here
lr_message("in Poll_0_RequestCB request callback");
return WEB_ASYNC_CB_RC_OK;
}
int Poll_0_ResponseBodyBufferCB(
const char * aLastBufferStr,
int aLastBufferLen,
const char * aAccumulatedStr,
int aHttpStatusCode)
{
//enter your implementation for ResponseBodyBufferCB() here
// when the response is received, update the global variable
done = 1;
// print out the response body and length
lr_message("in Poll_0_ResponseBodyBufferCB response body callback");
lr_message("in Poll_0_ResponseBodyBufferCB response body callback, lastBufferLen=%d", aLastBufferLen);
return WEB_ASYNC_CB_RC_OK;
}
int Poll_0_ResponseCB(
const char * aResponseHeadersStr,
int aResponseHeadersLen,
const char * aResponseBodyStr,
int aResponseBodyLen,
int aHttpStatusCode)
{
//enter your implementation for ResponseCB() here
lr_message("in Poll_0_ResponseCB response callback, headerLen=%d, bodyLen=%d", aResponseHeadersLen, aResponseBodyLen);
lr_message("in Poll_0_ResponseCB response callback, header=%s", aResponseHeadersStr);
lr_message("in Poll_0_ResponseCB response callback, body=%s", aResponseBodyStr);
return WEB_ASYNC_CB_RC_OK;
}
And the log output is:
Action.c(19): Notify: Transaction "async-call" started.
Action.c(25): web_reg_async_attributes started [MsgId: MMSG-26355]
Action.c(25): Warning -26318: When "Pattern" is not "Poll", "PollIntervalMs" is ignored [MsgId: MWAR-26318]
Action.c(25): web_reg_async_attributes highest severity level was "warning" [MsgId: MMSG-26391]
Action.c(36): web_url("Poll_0") started [MsgId: MMSG-26355]
Action.c(36): "ID=poll_0" && "Pattern=LongPoll" now applied to URL="https://{Env}/chat/poll/" (RelFrameId=1, Internal ID=3) [MsgId: MMSG-35172]
in Poll_0_RequestCB request callback
Action.c(36): Retaining cross-step download of URL="https://{Env}/chat/poll/" (RelFrameId=1, Internal ID=3) [MsgId: MMSG-27658]
Action.c(36): web_url("Poll_0") was successful, 0 body bytes, 0 header bytes [MsgId: MMSG-26386]
Action.c(41): lr_force_think_time: 10.00 seconds.
Send interop message
Action.c(46): Notify: Transaction "/chat/.POST.201" started.
Action.c(48): web_add_header("X-Session-ID") started [MsgId: MMSG-26355]
Action.c(48): web_add_header("X-Session-ID") was successful [MsgId: MMSG-26392]
Action.c(50): web_custom_request("Push interop message") started [MsgId: MMSG-26355]
Action.c(50): Retaining cross-step download of URL="https://{Env}/chat/poll/" (RelFrameId=1, Internal ID=3) [MsgId: MMSG-27658]
Action.c(50): Retaining cross-step download of URL="https://{Env}/chat/poll/" (RelFrameId=1, Internal ID=3) [MsgId: MMSG-27658]
Action.c(50): Retaining cross-step download of URL="https://{Env}/chat/poll/" (RelFrameId=1, Internal ID=3) [MsgId: MMSG-27658]
Action.c(50): web_custom_request("Push interop message") was successful, 0 body bytes, 377 header bytes [MsgId: MMSG-26386]
Action.c(58): web_get_int_property started [MsgId: MMSG-26355]
Action.c(58): web_get_int_property was successful [MsgId: MMSG-26392]
Action.c(64): Notify: Transaction "/chat/.POST.201" ended with "Pass" status (Duration: 1.3904 Wasted Time: 0.0033).
Waiting for response
Action.c(76): lr_force_think_time: 1.00 seconds.
Action.c(76): Error -27653: Attempted read from an unconnected socket ("Connection: close" specified but server-side closure not detected). URL="https://{Env}/chat/poll/" [MsgId: MERR-27653]
Action.c(36): Warning -27764: Request "https://{Env}/chat/poll/" failed [issued at Action.c(76)] [MsgId: MWAR-27764]
Action.c(76): Notify: Deleting Conversation Information with ID="poll_0"
Action.c(76): lr_force_think_time: 1.00 seconds.
Action.c(76): lr_force_think_time: 1.00 seconds.
Action.c(76): lr_force_think_time: 1.00 seconds.
Action.c(76): lr_force_think_time: 1.00 seconds.
Action.c(80): Notify: Transaction "async-call" ended with "Pass" status (Duration: 19.0076 Think Time: 16.5943 Wasted Time: 0.0043).
Action.c(83): web_stop_async started [MsgId: MMSG-26355]
Action.c(83): Warning -26000: Failed to find conversation with ID="poll_0" for stopping [MsgId: MWAR-26000]
Action.c(83): web_stop_async highest severity level was "warning" [MsgId: MMSG-26391]
Ending action Action.
I'm using VuGen 11.52 and C API

Related Links

Koa 2 router how to make a long poll request
Confluent long polling properties in kafka-rest
How to combine async and blocking requests in VuGen?
Long polling confusion
WAS Liberty & Atmosphere long-polling 1 min delay
Long Polling interval in atmosphere
MQTT long polling over GPRS/HSDPA
JS and CSS file fails to load when the page is refreshed in grails application which uses Atmosphere Meteor plugin
Security concerns in long polling
Kafka long polling
How to build the request for a long poll url for box.com
how to access enterprise events using Java code
Handle client timeouts when serving long polling with gevent
Long polling blocking multiple windows?
Long polling on a penny auction site?
Cannot implement long polling

Categories

HOME
smarty
appx
adb
maven-3
amortized-analysis
amazon-ecs
callback
pivotal-cloud-foundry
kibana-4
dax
usergrid
clojurescript
propel
reactive-cocoa
excel-vba-mac
shared-hosting
emulator
tar
kannel
pingfederate
rst2pdf
jaxb2
gitignore
media-queries
ioio
contact-form
normal-distribution
hexo
overlap
revolution-slider
dosbox
withings
unobtrusive-validation
ensembles
mapzen
fedex
reportingservices-2005
angular2-meteor
menuitem
azure-application-gateway
return-value
tizen-native-app
magma
feeds
sybase-asa
pdfclown
spring-mongodb
titanium-android
dwscript
minimization
blacklist
topbeat
google-cdn
xcb
log4c
nsfilemanager
moveit
phpcas
uid
qtableview
lemon
atk4
embedded-code
sortedlist
csquery
tt-news
angularjs-ng-click
rebol3
system.net.webexception
hippomocks
gnu-smalltalk
geos
sitemesh
opcache
gwt-rpc
random-seed
pygit2
bluepill
runas
viewswitcher
pendrive
appender
gdlib
asp.net-mvc-areas
substrings
defensive-programming
signal-handling
ntvdm.exe

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App