Socket stuck in FIN_WAIT_1

All types of networks, network stacks, and protocols supported by OpenVMS.
Post Reply

Topic author
brianreiter
Active Contributor
Posts: 26
Joined: Fri Jun 14, 2019 4:17 pm
Reputation: 0
Status: Offline

Socket stuck in FIN_WAIT_1

Post by brianreiter » Wed Sep 25, 2019 11:31 am

Hi Folks,

Does anyone happen to know the magic incantation to get a socket of of FIN_WAIT_1 state? The socket is apparently created with REUSEADDR and REUSEPORT by the application. If the application goes down the client follows suit, leaving the socket in FIN_WAIT_1 state, where it persists for around 10 minutes.

Is there anything configurable we can do to reduce the timeout period or delete the socket?

The system is OpenVMS V8.4-2L1 and TCPIPV5.7 - ECO 5.

cheers

Brian


Topic author
brianreiter
Active Contributor
Posts: 26
Joined: Fri Jun 14, 2019 4:17 pm
Reputation: 0
Status: Offline

Re: Socket stuck in FIN_WAIT_1

Post by brianreiter » Thu Sep 26, 2019 10:09 am

Well I managed to get it working, after browsing through the WASD source code. It looks like the issues is with how the initial IO$_SETMODE is made. Initially the code was trying to everything in one QIOW call but it appears that it is order dependent. The first QIOW is performs the socket options only:

Code: Select all

        return_status := $QIOW (        efn     := EFN$C_ENF ,
                                        chan    := ip_channel ,
                                        func    := IO$_SETMODE ,
                                        iosb    := connect_iosb ,
                                        p1      := %ref socket_param ,
                                        p5      := %ref socket_options_desc ) ;
The second QIOW sets up all the other stuff such as the local socket parameters and the backlog value:

Code: Select all

            return_status := $QIOW (    efn     := EFN$C_ENF ,
                                        chan    := ip_channel ,
                                        func    := IO$_SETMODE ,
                                        iosb    := connect_iosb ,
                                        p3      := %ref local_socket_desc ,
                                        p4      := %IMMED backlog ) ;
For reference the initial IO$_SETMODE call was:

Code: Select all

        return_status := $QIOW (        efn     := EFN$C_ENF ,
                                        chan    := ip_channel ,
                                        func    := IO$_SETMODE ,
                                        iosb    := connect_iosb ,
                                        p1      := %ref socket_param ,
                                        p3      := %ref local_socket_desc ,
                                        p4      := %IMMED backlog ,
                                        p5      := %ref socket_options_desc ) ;
So now after a restart the application is able to create its socket without having to delay for 15 minutes or so.

Is this documented anywhere? I’m happy its working but it does seem odd that is order dependent.

Post Reply