Skip to Content.
Sympa Menu

ndt-dev - [ndt] r341 committed - Part of the ToDo on error handling. The server can send the '9988' si...

Subject: NDT-DEV email list created

List archive

[ndt] r341 committed - Part of the ToDo on error handling. The server can send the '9988' si...


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt] r341 committed - Part of the ToDo on error handling. The server can send the '9988' si...
  • Date: Fri, 09 Apr 2010 17:05:15 +0000

Revision: 341
Author: rcarlson501
Date: Fri Apr 9 09:49:47 2010
Log: Part of the ToDo on error handling. The server can send the '9988' signal
multiple times. Old clients will see this and report a 'server busy' signal.
The NDT applet and commandline client will report a 'server busy' if no
valid wait time was received, otherwise they will report an ' unknown fault'
occurred.

Note messages are now in a .properties file for multi-lingual support.

RAC 4/9/10


http://code.google.com/p/ndt/source/detail?r=341

Modified:
/trunk/Applet/Makefile.in
/trunk/Applet/Tcpbw100.java
/trunk/Applet/Tcpbw100_msgs_en_US.properties
/trunk/Applet/Tcpbw100_msgs_nb_NO.properties
/trunk/src/web100clt.c
/trunk/src/web100srv.c

=======================================
--- /trunk/Applet/Makefile.in Sun Feb 28 11:29:32 2010
+++ /trunk/Applet/Makefile.in Fri Apr 9 09:49:47 2010
@@ -221,7 +221,7 @@
Tcpbw100dir = $(ndtdir)
Tcpbw100_JAVA = Tcpbw100.java
Tcpbw100_jar_SOURCES = Tcpbw100.java
-EXTRA_DIST = MANIFEST.MF
+EXTRA_DIST = MANIFEST.MF Tcpbw100_msgs_en_US.properties Tcpbw100_msgs_nb_NO.properties
all: all-am

.SUFFIXES:
@@ -549,7 +549,7 @@
$(GCJ) $(NDTGCJFLAGS) $(Tcpbw100_JAVA)

Tcpbw100.jar: Tcpbw100.class
- $(NDTJAR) $(NDTJARFLAG) MANIFEST.MF Tcpbw100.jar Tcpbw100*.class
+ $(NDTJAR) $(NDTJARFLAG) MANIFEST.MF Tcpbw100.jar Tcpbw100*.class Tcpbw100*.properties
echo timestamp > classTcpbw100.stamp

# Tell versions [3.59,3.63) of GNU make to not export all variables.
=======================================
--- /trunk/Applet/Tcpbw100.java Thu Apr 8 13:53:43 2010
+++ /trunk/Applet/Tcpbw100.java Fri Apr 9 09:49:47 2010
@@ -1390,7 +1390,7 @@
int ctlport = 3001;
double wait2;
int sbuf, rbuf;
- int i, wait;
+ int i, wait, swait=0;

failed = false;

@@ -1461,9 +1461,15 @@
}

if (wait == 9988) {
+ if (swait == 0) {
errmsg = messages.getString("serverBusy") + "\n";
failed = true;
return;
+ } else {
+ errmsg = messages.getString("serverFault") + "\n";
+ failed = true;
+ return;
+ }
}

if (wait == 9999) {
@@ -1481,6 +1487,7 @@
// tests in the queue.
wait = (wait * 45);
results.append(messages.getString("otherClient") + wait + messages.getString("seconds") +".\n");
+ swait = 1;
}

f.toBack();
=======================================
--- /trunk/Applet/Tcpbw100_msgs_en_US.properties Thu Apr 8 13:53:43
2010
+++ /trunk/Applet/Tcpbw100_msgs_en_US.properties Fri Apr 9 09:49:47
2010
@@ -158,6 +158,7 @@
seconds = seconds
server = Server
serverAcksReport = Server Acks report link is
+serverFault = Server Fault: unknown fault occurred. Please try again later
serverBusy = Server Busy: Too many clients waiting in server queue. Please try again later
serverBusy15s = Server Busy: Please wait 15 seconds for previous test to finish
serverBusy30s = Server busy: Please wait 30 seconds for previous test to finish
=======================================
--- /trunk/Applet/Tcpbw100_msgs_nb_NO.properties Thu Apr 8 13:53:43
2010
+++ /trunk/Applet/Tcpbw100_msgs_nb_NO.properties Fri Apr 9 09:49:47
2010
@@ -157,6 +157,7 @@
seconds = sekunder
server = Tjener
serverAcksReport = basert p\u00e5 ack fra tjeneren ansl\u00e5s linken til
+serverBusy = Tjener Forkastningen; Ukjente forkastningen oppstod. Du kan pr\u00f8ve senere
serverBusy = Tjener opptatt; For mange klienter i k\u00f8. Du kan pr\u00f8ve senere
serverBusy15s = Tjener opptatt; vennligst vent 15 sekunder mens forrige test kj\u00f8res ferdig
serverBusy30s = Tjener opptatt; vennligst vent 30 sekunder mens forrige test kj\u00f8res ferdig
=======================================
--- /trunk/src/web100clt.c Fri Apr 9 09:23:03 2010
+++ /trunk/src/web100clt.c Fri Apr 9 09:49:47 2010
@@ -596,7 +596,7 @@
int
main(int argc, char *argv[])
{
- int c;
+ int c, swait;
char tmpstr2[512], tmpstr[16384], varstr[16384];
unsigned char tests = TEST_MID | TEST_C2S | TEST_S2C | TEST_SFW | TEST_STATUS;
int ctlSocket;
@@ -741,6 +741,7 @@
exit(0);
}

+ swait = 0;
for (;;) {
msgLen = sizeof(buff);
if (recv_msg(ctlSocket, &msgType, buff, &msgLen)) {
@@ -766,7 +767,10 @@
exit(0);
}
if (xwait == 9988) {
- fprintf(stderr, "Server Busy: Too many clients waiting in queue, plase try again later.\n");
+ if (swait == 0)
+ fprintf(stderr, "Server Busy: Too many clients waiting in queue, plase try again later.\n");
+ else
+ fprintf(stderr, "Server Fault: Test terminated for unknown reason, plase try again later.\n");
exit(0);
}
if (xwait == 9999) {
@@ -784,6 +788,7 @@
xwait = (xwait * 45);
log_print(0, "Another client is currently begin served, your test will ");
log_println(0, "begin within %d seconds", xwait);
+ swait = 1;
}

/* add alarm() signal to kill off client if the server never finishes the tests
=======================================
--- /trunk/src/web100srv.c Fri Apr 9 09:23:03 2010
+++ /trunk/src/web100srv.c Fri Apr 9 09:49:47 2010
@@ -1777,7 +1777,8 @@
if ((waiting < 0) || (mclients < 0)) {
log_println(6, "Fault: Negative number of clents waiting=%d, mclients=%d, nuke them", waiting, mclients);
while (head_ptr != NULL) {
- send_msg(head_ptr->ctlsockfd, SRV_QUEUE, "9888", 4);
+ /* send_msg(head_ptr->ctlsockfd, SRV_QUEUE, "9933", 4); */
+ send_msg(head_ptr->ctlsockfd, SRV_QUEUE, "9988", 4);
shutdown(head_ptr->ctlsockfd, SHUT_WR);
close(head_ptr->ctlsockfd);
tpid = head_ptr->pid;
@@ -1793,7 +1794,8 @@
if ((waiting == 0) && (head_ptr != NULL)) {
log_println(6, "Fault: Something [%d] in queue, but no waiting clients", head_ptr->pid);
while (head_ptr != NULL) {
- send_msg(head_ptr->ctlsockfd, SRV_QUEUE, "9777", 4);
+ /* send_msg(head_ptr->ctlsockfd, SRV_QUEUE, "9977", 4); */
+ send_msg(head_ptr->ctlsockfd, SRV_QUEUE, "9988", 4);
shutdown(head_ptr->ctlsockfd, SHUT_WR);
close(head_ptr->ctlsockfd);
tpid = head_ptr->pid;
@@ -1820,7 +1822,8 @@
log_println(6, "pipe-fd=%d, running=%d, ctlsockfd=%d, client-type=%d, tests='%s'",
head_ptr->pipe, head_ptr->running,
head_ptr->ctlsockfd,
head_ptr->oldclient, head_ptr->tests);
- send_msg(head_ptr->ctlsockfd, SRV_QUEUE, "9666", 4);
+ /* send_msg(head_ptr->ctlsockfd, SRV_QUEUE, "9966", 4); */
+ send_msg(head_ptr->ctlsockfd, SRV_QUEUE, "9988", 4);
shutdown(head_ptr->ctlsockfd, SHUT_WR);
close(head_ptr->ctlsockfd);
tpid = head_ptr->pid;
@@ -2083,7 +2086,8 @@

if ((testing == 1) && (queue == 0)) {
log_println(3, "queuing disabled and testing in progress, tell client no");
- send_msg(new_child->ctlsockfd, SRV_QUEUE, "9444", 4);
+ /* send_msg(new_child->ctlsockfd, SRV_QUEUE, "9944", 4); */
+ send_msg(new_child->ctlsockfd, SRV_QUEUE, "9988", 4);
close(chld_pipe[1]);
shutdown(new_child->ctlsockfd, SHUT_WR);
close(new_child->ctlsockfd);


  • [ndt] r341 committed - Part of the ToDo on error handling. The server can send the '9988' si..., ndt, 04/09/2010

Archive powered by MHonArc 2.6.16.

Top of Page