Project

General

Profile

action #136004

Updated by szarate 8 months ago

## Observation 

 While debugging https://openqa.suse.de/tests/12181788 I found out that sometimes a service can take longer and an immediate restart could cause an error. 

 ``` 
 Sep 19 08:14:21 server rpc.mountd[3031]: Caught signal 15, un-registering and exiting. 
 Sep 19 08:14:21 server systemd[1]: nfs-mountd.service: Succeeded. 
 Sep 19 08:14:21 server systemd[1]: Stopped NFS Mount Daemon. 
 Sep 19 08:14:21 server systemd[1]: nfs-idmapd.service: Succeeded. 
 Sep 19 08:14:21 server systemd[1]: Stopped NFSv4 ID-name mapping service. 
 Sep 19 08:14:21 server systemd[1]: Starting NFSv4 ID-name mapping service... 
 Sep 19 08:14:21 server systemd[1]: Starting NFS Mount Daemon... 
 Sep 19 08:14:21 server systemd[1]: Started NFSv4 ID-name mapping service. 
 Sep 19 08:14:21 server kernel: nfsd: last server has exited, flushing export cache 
 Sep 19 08:14:21 server systemd[1]: Started NFS Mount Daemon. 
 Sep 19 08:14:21 server systemd[1]: Starting NFS server and services... 
 Sep 19 08:14:21 server rpc.mountd[3098]: Version 2.1.1 starting 
 Sep 19 08:14:21 server exportfs[3099]: exportfs: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/tmp/nfs/server". 
 Sep 19 08:14:21 server exportfs[3099]:     Assuming default behaviour ('no_subtree_check'). 
 Sep 19 08:14:21 server exportfs[3099]:     NOTE: this default has changed since nfs-utils version 1.0.x 
 Sep 19 08:14:21 server exportfs[3099]: exportfs: /etc/exports [3]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/home/tux". 
 Sep 19 08:14:21 server exportfs[3099]:     Assuming default behaviour ('no_subtree_check'). 
 Sep 19 08:14:21 server exportfs[3099]:     NOTE: this default has changed since nfs-utils version 1.0.x 
 Sep 19 08:14:21 server rpc.nfsd[3100]: rpc.nfsd: unable to bind AF_INET TCP socket: errno 98 (Address already in use) 
 ``` 

 In this case it failed at this line: https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/5251193c0ed3c8098771b9cfd5dc76c06abb0a53/tests/network/autofs_server.pm#L75 


 ### Acceptance Criteria 
 - AC1 When SUTS have high load (stress-ng can be used to simulate), service restarts are still working as expected 
 - AC2 New ticket exists for the implementation of what the notes on this ticket aren't implemented together 

 ### Notes 

 One idea that comes to my mind is to have the [Utils::Systemd::systemctl](https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/5251193c0ed3c8098771b9cfd5dc76c06abb0a53/lib/Utils/Systemd.pm#L58) take two extra subroutines, one for a pre-check and a second one for a post-check and use a small check to verify that the port/socket is open 

 One example of how this could look like: 

 - `systemctl 'restart nfs-server', pre => sub { say hello_world }, post => \check_nfs_port;`

Back