Technical

Tips

I Want to Automatically Resend Files After Network Recovery

Introduction

Have you ever had a file transfer be interrupted, right in the middle of the transfer?
You can manually resend a file when a transfer is interrupted, but wouldn't it be convenient if you could resend those file automatically?

Well, the HULFT system includes a function that lets you do just that.
In this tip, we would spotlight this auto resend function.


Advance Preparation

The flow of processing for an auto resend is as follows:
1. Start a send thread.
2. Connect to the receive acknowledge thread.
 - When you cannot connect by using a socket connection, it will repeats the connection processing by the number of times was specified in Connect Retry Count.
3. During a file transfer, a communication abnormality or a failover on the receiving host occurs.
4. Output log records and execute post-sending jobs.
5. Perform Auto Resend.
 The following processing is executed a number of times equal to the value specified for the Auto Resend Retry Count
 - Wait for the period of time specified for the Connect Retry Interval in the System Environment Settings.
 - Perform the above steps 2-4.

Because of this, you must specify the Connect Retry Count, the Auto Resend Retry Count, and the Connect Retry Interval in order to perform auto resend.

  • - Connect Retry Count

Specify the number of times to attempt to reconnect if socket connection fails.
This is a function that reattempts to connect with the other host if an attempt to establish a TCP/IP connection fails, resulting in an error.

  • - Connect Retry Interval

Specify the period of time to wait before making another attempt to reconnect if socket connection fails.
This is a function that waits for the specified period of time before reattempting to connect with the other host if an attempt to establish a TCP/IP connection fails, resulting in an error.

  • - Auto Resend Retry Count

Specify the number of times to attempt an auto resend if a communication abnormality occurs during send processing.
If you specify "0", auto resend will not be carried out.


Flow of Processing for Auto Resend
How Checkpoint Resend File Works

You can automatically execute resend processing when an error related to the network or a forced termination as the result of a failover occurs during a file transfer.

Now, let's look at the flow of processing for an auto resend.

  • 1. Start a send thread.

    The send acknowledge thread starts the send thread.

    • 2. Connect to the receive acknowledge thread.

    The send thread connects to the receive acknowledge thread, and transfers the file.
    If the send thread cannot connect to the receive acknowledge thread, it repeats the connection processing by the number of times was specified in Connect Retry Count in the System Environment Settings.

    • 3. A communication abnormality or a failover on the receiving host occurs.

    When an abnormality occurs in the communication network or when a forced termination occurs as the result of a failover, the send thread detects the abnormality and terminates processing.

    • 4. Write to the Send Log List and execute the post-send job.

    The send thread writes the results of the communication abnormality to the send log file and executes the job that is registered to be performed in case of abnormalities.

    • 5. Perform auto resend.

    If the error that occurred in step 3 was a communication abnormality, the send thread waits for the period of time specified for Connect Retry Interval in the System Environment Settings.
    After waiting for the specified period, the send thread repeats steps 2 through 4 the number of times specified for Auto Resend Retry Count in the System Environment Settings.

    • 6. Notify the send acknowledge thread of the send results.

    The send thread notifies the send acknowledge thread of the send results..

    • 7. Record information to Resend Queue Status List.

    If the send results received from the send thread indicate an abnormality, the send acknowledge thread writes the information to Resend Queue Status List.

    • Reference

    - You can manually resend the files that are output as records to the resend queue file by executing the Resend File Command (utlsend -r).

    - If the error that occurs in step 3 is a communication abnormality, the receiving host executes end processing and ends the receive process.
    If the send process is able to reconnect to the receiving host via auto resend, the receive acknowledge thread will re-created.


    Example of Execution

    If an attempt to send a file is suspended because of a network error (for example, if the HULFT receive process on the other host stops, or if the socket is disconnected), the send thread waits for the period of time specified for Connect Retry Interval in the System Environment Settings.

    You can check the processing results in the Send Log List.
    Note: From the Console, you can verify that the resend process started and ended.


    When auto resend is successful

    The send process ends normally.


    When auto resend is unsuccessful

    The send process ends abnormally, and information about the resend (Resend Queue Status List) was outputed.


    Error Codes for Which Auto Resend Can Be Used

    Auto resend can be used when the following error codes are output.

    • When a communication abnormality occurs:

    If a communication error occurs while a file is being sent, one of the following end codes related to the system is output to the Send Log List.
    - 731: Send processing failed.
    - 732: Receive processing failed.
    - 735: A timeout occurred during the receive processing of the data.

    • When a transfer is forcibly terminated because of a failover on the receiving host:

    When a failover occurs on the receiving host, one of the following error codes is output to the Send Log.
    - 450: End code for the send process (An abnormality occurred on the receiving host.)
    - 591: End code for the receiving host indicating that the transfer was forcibly terminated
    Note: For details, see any error codes or messages that are output on the receiving host.

    1. Reference

    You can detect a forcible termination as the result of a failover on the receiving host if one of the following products is installed on the receiving host:
    - HULFT for UNIX/Linux
    - HULFT for Windows Version 7.3.0 or later


    Conclusion

    So, what do you think?
    By using the auto resend function, you can automatically resume the sending of a file after a network recovery, even if communication is suspended in the middle of a file transfer.