GDSX (Extended General Device Support) Manual
DEVICE^HANDLER Example, Design
Extended General Device Support (GDSX) Manual—529931-001
5-21
Testing Failure at a ^WRITEREAD
but do not enter a carriage return. The requester and the DEVICE^HANDLER task
now have pending WRITEREADs.
At the TACL terminal, simulate a GDSX process failure by entering:
> STOP primary-cpu, primary-pin
At the application terminal, after the CPU and PIN prompt and the text that you
entered, in approximately half a minute you should see the following message:
PLEASE RE-ENTER DATA
followed by a new CPU and PIN prompt. Enter a text string or two to verify that the
system is still running as usual. Note that the prompt did not change. GDSX, not the
requester, switched over.
At the TACL terminal, enter:
> STATUS *, TERM
Record the new CPU and PIN values for the GDSX process:
primary-cpu,primary-pin backup-cpu,backup-pin
When $GDS was stopped, file-system error 210 was returned to $A1. The code then
executed by $A1 is shown in Example 5-6. A message is sent by way of the new
primary process to the OUT file requesting that data be reentered, because anything
that was entered at a prompt before a carriage return was entered was not transferred
to the IOP. Then, after a two-second delay, a new prompt is sent to the terminal,
starting a new WRITEREAD-WRITE transaction. Therefore, the DEVICE^HANDLER
is designed so that it does not retry a ^WRITEREAD following a takeover.
Fault-tolerance processing in the DEVICE^HANDLER is diagrammed in Figure 5-6.
The fault-tolerance code is included in the listing in Appendix B. Suppose that the
DEVICE^HANDLER was executing a ^WRITEREAD when the primary process failed.
The GDSX backup process then takes over, and TSCODE restarts the
DEVICE^HANDLER at the return from the call to ^CHECKPOINT(2), which in this case
is the TAKEOVER := TRUE statement.
TSCODE restarts at this point because whenever there is a call to the ^CHECKPOINT
function, TSCODE establishes a restart point in the calling task at the return from the
call, in a manner similar to a call to the Guardian procedure CHECKPOINT. If there
Example 5-6. Requester Code for Takeover at a ^WRITEREAD
ELSE IF (FERR = 210) THEN
BEGIN ! OUTFILE SWITCHED TO BACKUP, CONTINUE
WT^CT :=28;
S^MSG^BUF ':=' 8*[“ “] & [“PLEASE RE-ENTER DATA“];
CALL WRITE(MSG^FILE,MSG^BUF,WT^CT);
IF <> THEN
BEGIN ! CONTINUE ON GDSX SWITCHOVER
CALL FILEINFO(MSG^FILE,FERR);
IF (FERR <> 210) THEN CALL DEBUG;
END;
END