| From: ALFAM7::BECKER "Hartmut Becker - VMS & Languages Support, Munich 30-Apr-1997 1450 +0200" 30-APR-1997 14:52:08.11
To: NASAXP::"[email protected]"
CC: BECKER
Subj: temporary mailboxes, asap log number 27090
Hi Roger,
I'm sorry, from your description I can't identify any problem. I'm also not
aware of general mailbox problems in OpenVMS. If you give me some more
information I can scan our databases.
I assume your application runs on Alpha, which version of OpenVMS are you using?
What are the process states of the server and client? (LEF/HIB...?)
How do you write to and read from the mailbox, $qio or $qiow?
Do you use event flags, asts?
Do you get any status information? Return code or IOSB?
Can you re-produce the problem with a small example?
On the other hand I can give some hints how to look at the mailboxes from VMS.
You need privileges to run SDA and you need to know the mailbox number (SDA>
show process/channel can give you all open channels for the specified process,
there you should find your mailbox).
For example you can do (example from OpenVMS/Alpha V7.1):
$ anal/sys
SDA> sh dev MBA9020:
MBA9020 MBX UCB:
80EF8F40
Device status: 08000010 online,exfunc_supp
Characteristics: 0C150001 rec,shr,avl,mbx,idv,odv
00000200 nnm
Owner UIC [000100,000005] Operation count 33 ORB address 80FE3F40
PID 00000000 Error count 0 DDB address 84AA9680
Class/Type A0/01 Reference count 1 DDT address 84AC8340
Def. buf. size 256 BOFF 00000000 CRB address 84AA96C8
DEVDEPEND 00000020 Byte count 00000000 LNM address 85DA7410
DEVDEPND2 00000000 SVAPTE 00000000 I/O wait queue 80EF8FAC
DEVDEPND3 00000000 DEVSTS 00000002
FLCK index 2C
DLCK address 84AB1E00
Charge PID 00050071
*** I/O request queue is empty ***
SDA>
Operation count is total number of successful reads/writes
(and some other i/os)
if the mailbox was just created you will see an operation count of 0 but there
can already be messages queued. See below, the val command shows them.
Reference count shows how many channels are assigned to this mailbox
I assume in your case you find a 2, one channel from the server,
another one from the client
SDA> val q UCB
Queue is complete, total of 32 elements in the queue
This shows the message blocks in the mailbox, each block represents a
a message in the mailbox
SDA> ex @.;80
00000000 20130080 80EF8F40 80D16A00 .j�.@.�.... .... FFFFFFFF.80C93040
00000000 00000000 00000000 7FFABED0 �............... FFFFFFFF.80C93050
000500B4 00010021 80C93070 000500B4 ...p0�.!........ FFFFFFFF.80C93060
7074756F 24737973 20657469 72772024 $ write sys$outp FFFFFFFF.80C93070
6B6E756A 20736920 73696874 22207475 ut "this is junk FFFFFFFF.80C93080
4B5F4552 41575446 4F533A4F 464E4922 "INFO:SOFTWARE_K FFFFFFFF.80C93090
00000000 00000000 0053494C 2E535449 ITS.LIS......... FFFFFFFF.80C930A0
00000000 00000000 00000000 00000000 ................ FFFFFFFF.80C930B0
This shows the first message block
the message is appended, message size is at offset 2c
SDA> ex @.;80
...
shows the next message block (we have 32 in the queue)
@. is relative addressing, . is the current address, @. is it's contents
So the first @. only works if the UCB is the current address (which is set with
the val q UCB command. The next @. only works if no other command sets a new
current address. Here you can issue 32 ex @.;80 commands, in general as many as
elements in the queue.
Hope this helps,
Hartmut
--------------------------------------------------------------------------------
Digital Equipment GmbH
Software Partner Engineering
Hartmut Becker [email protected]
Freischuetzstr. 91 Telefon [49](89)9591-0
D-81927 Muenchen Telefax [49](89)9591-2220
|
| From: ALFAM7::VBORMC::"[email protected]" "Roger Woodward 07-May-1997 1501 +0200" 7-MAY-1997 15:01:06.97
To: "Hartmut Becker - VMS & Languages Support, Munich" <[email protected]>
CC:
Subj: asap log number 27090
Hi Harmut
In message <[email protected]>, "Hartmut Becker -
VMS & Languages Support, Munich" <[email protected]> writes
>I'm sorry, from your description I can't identify any problem. I'm also not
>aware of general mailbox problems in OpenVMS. If you give me some more
>information I can scan our databases.
This is a more complete description of the problem.
The server once started services calls from a variable number of
clients. There appear to be no problems until the server is left alone
for a while (i.e. no clients are active), if for example the server is
left overnight. When the first call to the server takes place in the
morning, the client QIOW returns with a status of 0 having timed out
immediately (this is slightly suprising, from reading the documentation
I would have expected SS$_CANCEL to be returned).
Further requests operate normally.
>
>I assume your application runs on Alpha, which version of OpenVMS are you using?
The application is running on a clustered Vax, running openVMS v. 6.2.
We will be migrating to the Alpha in the near future.
>
>What are the process states of the server and client? (LEF/HIB...?)
The client is started up as an interactive process so will either be COM
or LEF.
The server state is LEF before and after the call by the client.
In order to replicate this problem without having to wait a couple of
hours, my colleague at SMS runs a cpu intensive program. This process
runs at the same priority as the client and server.
>
>How do you write to and read from the mailbox, $qio or $qiow?
the client
writes with $QIO
then reads with $QIOW and a timeout on the channel
the server
reads with $QIOW
then writes with $QIOW
>Do you use event flags, asts?
no
>
>Do you get any status information? Return code or IOSB?
the first client read times out with a status 0
>
>Can you re-produce the problem with a small example?
>
not yet
thanks for the advice on looking at mailboxes, we are looking at them
today.
The following is most of the client/server code for reference. The
server is built with HRGSERVER defined, the client without HRGSERVER
defined.
#ifndef HRGSERVER
/*******************************************
* timerCallback
*
* if the timer expires, the timer callback function is called
* and the original qiow falls through
********************************************/
static void timerCallback(long param, long pc, long ps1, long rzero,
long rone)
{
// cancel the I/O
statusVMS = sys$cancel( cancelChan );
if ( statusVMS != SS$_NORMAL )
lib$stop( statusVMS );
#if DEBUG
printf("cancelling qio\n");
#endif
timerFlag = -1;
}
/*******************************************
* startTimer
*
* start up timer based on parameters set up in setTimer
********************************************/
static void startTimer()
{
statusVMS = sys$setimr(0, &binaryTime, &timerCallback, 0 );
if ( statusVMS != SS$_NORMAL )
lib$stop( statusVMS );
}
#endif
/*******************************************
* ReceiveNetMsg
*
* receive a network message
* because mailboxes work on two channels for
* communication, ConnFD is not used. channels
* are maintained instead in the client list
********************************************/
extern int ReceiveNetMsg(int ConnFD, char *MsgBufPtr, int MsgBufLen)
{
int NBytes;
short channel;
QIO_STATUS_BLOCK iosb;
char clientMboxId[16];
int status = 0;
#ifdef HRGSERVER
channel = toServerChannel;
#else
channel = fromServerChannel;
// timeout mechanism for the client
cancelChan = channel;
startTimer();
#endif
/* read from the server mailbox */
/* this connection uses a timeout on the client side*/
status = sys$qiow(2, channel, IO$_READVBLK, &iosb, 0, 0,
MsgBufPtr, MsgBufLen-1, 0,0,0,0);
#ifdef HRGSERVER
if (status != SS$_NORMAL)
lib$stop(status);
#else
{
int canStatus = sys$cantim(0,0);
if (canStatus != SS$_NORMAL)
lib$stop(canStatus);
// timeout
if ( timerFlag < 0 )
{
#if DEBUG
printf("channel has timed out\n");
#endif
// all channels to the server are now invalid
lclose(toServerChannel);
lclose(fromServerChannel);
timerFlag = 0;
statusVMS = status;
return( MESSAGE_TIMEOUT );
}
if ( status != SS$_NORMAL )
if (status == SS$_IVCHAN)
{
statusVMS = status;
return( MESSAGE_TIMEOUT );
}
else
lib$stop(status);
}
#endif
if ((iosb.cond_value &1) != 1)
lib$stop( iosb.cond_value );
/* null terminate the string */
*(MsgBufPtr+iosb.count) = '\0';
#ifdef DEBUG
printf("message buffer <%d><%d><%s>\n",MsgBufLen,iosb.count,MsgBufPt
r);
#endif
if (iosb.count <= 0) /* read() error or no bytes received */
return MESSAGE_DISCON;
#ifdef HRGSERVER
// server now links into the given mailbox
// first PID_LENGTH chars are the identity of the client
memcpy( clientMboxId, MsgBufPtr, PID_LENGTH );
*(clientMboxId + PID_LENGTH) = '\0';
checkMboxID( clientMboxId );
if (( fromServerChannel = findClient( clientMboxId )) <= 0 )
{
/* new connection requested from a client */
/* compose the mailbox name
(i.e. replace the xxxxxxxx in AG_CLIENT_MBxxxxxxxx) */
memcpy( (clientMailbox.dsc$a_pointer)+MBX_ID_PID_OFFSET,
clientMboxId, PID_LENGTH );
/* create the mailbox */
if ((( statusVMS = sys$assign(&clientMailbox,
&fromServerChannel,3,0,0)) &1) !=1)
lib$stop(statusVMS);
/* retain client details */
saveClient( clientMboxId, fromServerChannel );
if ( Debug )
{
char buff[80];
sprintf(buff, "server created client mailbox %s\n",
clientMailbox.dsc$a_pointer);
HRGTraceStatement(1, buff);
}
}
/* write over the client id in the message, the application above
us is not interested in it */
NBytes = iosb.count;
if ( NBytes > PID_LENGTH )
{
memmove( MsgBufPtr, MsgBufPtr + PID_LENGTH, NBytes - PID_LENGTH
);
NBytes -= PID_LENGTH;
}
#endif
return NBytes;
}
/*******************************************
* SendNetMsg
*
* send a network message
* because mailboxes work on two channels for
* communication ConnFD is not used. channels
* are maintained instead in the client list
********************************************/
extern int SendNetMsg(int ConnFD, char *MsgBufPtr, int MsgLen)
{
short channel;
QIO_STATUS_BLOCK iosb;
#ifndef HRGSERVER
char altMessage[MBX_SIZE + PID_LENGTH];
#endif
int status = 0;
statusVMS = 0;
#ifdef HRGSERVER
channel = fromServerChannel;
#else
channel = toServerChannel;
if ( toServerChannel < 0 )
{
// timed out, try to reconnect
if ( status = ConnectClient((char *)0, 0, 0) < 0 )
return( status );
}
// add client id to the start of the message
sprintf( altMessage, "%08.8X", getpid() );
memcpy(altMessage+PID_LENGTH, MsgBufPtr, (MsgLen>MBX_SIZE?MBX_SIZE:M
sgLen));
#endif
/* write message to the mailbox */
#ifdef HRGSERVER
if (((statusVMS = sys$qiow( 1, channel, IO$_WRITEVBLK, &iosb, 0, 0,
MsgBufPtr, MsgLen, 0,0,0,0)) &1) != 1)
lib$stop(statusVMS);
#else /*qio*/
/* synchronous call to allow a timeout on the read */
statusVMS = sys$qio( 1, channel, IO$_WRITEVBLK, &iosb, 0, 0,
altMessage, MsgLen+PID_LENGTH, 0,0,0,0 );
if ( statusVMS != SS$_NORMAL )
if (statusVMS == SS$_IVCHAN)
return( HRG_TIMEOUT );
else
lib$stop(statusVMS);
#endif
#ifdef HRGSERVER
// following two lines removed if using qio
if ((iosb.cond_value &1) != 1)
lib$stop(iosb.cond_value);
// if this is a close message then delete the client from our list
// and close the channel
if ( strcmp(MsgBufPtr, UNLINK_CLIENT_RESULT) == 0)
{
lclose( channel );
deleteClient( channel );
}
#endif
return MsgLen;
}
I hope this begins to make sense. We will continue to invetigate
further.
Regards
roger
Roger Woodward
Woodward Associates (UK) Ltd
Phone/Fax: 01628 666083
e-mail: [email protected]
% ====== Internet headers and postmarks (see DECWRL::GATEWAY.DOC) ======
% Received: from mail.vbo.dec.com (mail.vbo.dec.com [16.36.208.34]) by vbormc.vbo.dec.com (8.7.3/8.7) with ESMTP id OAA00307 for <[email protected]>; Wed, 7 May 1997 14:49:09 +0200
% Received: from server21.digital.fr (server21.digital.fr [193.56.15.21]) by mail.vbo.dec.com (8.7.3/8.7) with ESMTP id PAA19288 for <[email protected]>; Wed, 7 May 1997 15:01:10 +0200 (MET DST)
% Received: from punt-1.mail.demon.net (relay-7.mail.demon.net [194.217.242.9]) by server21.digital.fr (8.7.5/8.7) with SMTP id PAA27436 for <[email protected]>; Wed, 7 May 1997 15:06:44 +0200 (MET DST)
% Received: from wyvis.demon.co.uk ([194.222.115.157]) by punt-1.mail.demon.net id aa0528663; 7 May 97 13:14 BS
% Message-ID: <[email protected]>
% Date: Wed, 7 May 1997 13:10:22 +0100
% To: "Hartmut Becker - VMS & Languages Support, Munich" <[email protected]>
% From: Roger Woodward <[email protected]>
% Subject: asap log number 27090
% MIME-Version: 1.0
% X-Mailer: Turnpike Version 3.01 <Rxlf5iwdh9IDwWvFxPqf08oxz1>
|