Jaideep Shankar
2022-Apr-07 08:17 UTC
[Samba] A disconnected network can, for all practical purposes, hang your system.
Hi, Record locks taken on a remote file remains valid, even after 1 hour of network disconnection. The following test case describes the set of activities done in chronological order: * A process (P1) on a windows client (C1) and another process (P2) on a Linux client (C2) are connected to a common Linux server and accessing the same remote file. * Both P1 and P2 opens the remote file and gets a handle each. * P1 takes exclusive lock on offset 0. * P2 tries to take exclusive lock on offset 0 in a loop but does not get since P1 holds an exclusive lock on the same offset. * Now, P1 is disconnected from remote file (C1 is disconnected from server). Result: P2 does not get lock, returns 'EACCES' instantaneously, tried for around an hour. The results were surprising, since in a Wi-Fi environment, where systems keep coming in and out, it can potentially stall the system. OS specs of C1 - Windows 10 Enterprise (version: 20H2, build: 19042.1237) OS specs of C2 - Ubuntu 20.04.3 LTS (GNU/Linux 5.13.0-1021-azure x86_64) OS specs of Linux Server - Ubuntu 20.04.1 LTS (GNU/Linux 5.13.0-37-generic x86_64) Samba version on C2 - 4.13.17-Ubuntu Command used - smbststus Samba version on Linux server - 4.13.17-Ubuntu Command used - smbstatus Samba version on C1 - SMBv2/v3 Command used - sc.exe qc lanmanworkstation<https://ind01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fstorage%2Ffile-server%2Ftroubleshoot%2Fdetect-enable-and-disable-smbv1-v2-v3%23how-to-detect-status-enable-and-disable-smb-protocols-on-the-smb-server&data=04%7C01%7Cjaideep.shankar%40tallysolutions.com%7Cd89e6d87df344ff9528008da16e285f6%7C66bcd9b727254893bb969ae424774af6%7C0%7C0%7C637847459425410980%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=qEmZj%2Fc1RtYLDut%2BDu%2B6SgmbKnJeNVrftx2xhJO7%2F4s%3D&reserved=0> Protocol version - 3.1.1 (same on both connections) Command used - smbstatus The smb config file on the Linux server is also attached. Regards, Jaideep
Rowland Penny
2022-Apr-07 08:26 UTC
[Samba] A disconnected network can, for all practical purposes, hang your system.
On Thu, 2022-04-07 at 08:17 +0000, Jaideep Shankar via samba wrote:> Hi, > > Record locks taken on a remote file remains valid, even after 1 hour > of network disconnection. The following test case describes the set > of activities done in chronological order: > > > * A process (P1) on a windows client (C1) and another process > (P2) on a Linux client (C2) are connected to a common Linux server > and accessing the same remote file. > * Both P1 and P2 opens the remote file and gets a handle each. > * P1 takes exclusive lock on offset 0. > * P2 tries to take exclusive lock on offset 0 in a loop but does > not get since P1 holds an exclusive lock on the same offset. > * Now, P1 is disconnected from remote file (C1 is disconnected > from server). > > Result: P2 does not get lock, returns 'EACCES' instantaneously, tried > for around an hour. > > The results were surprising, since in a Wi-Fi environment, where > systems keep coming in and out, it can potentially stall the system. > > OS specs of C1 - Windows 10 > Enterprise (version: 20H2, build: 19042.1237) > OS specs of C2 - Ubuntu 20.04.3 LTS > (GNU/Linux 5.13.0-1021-azure x86_64) > OS specs of Linux Server - Ubuntu 20.04.1 LTS > (GNU/Linux 5.13.0-37-generic x86_64) > > Samba version on C2 - 4.13.17- > Ubuntu Command used - > smbststus > Samba version on Linux server - 4.13.17- > Ubuntu Command used - > smbstatus > Samba version on C1 - > SMBv2/v3 CommandI think you mean SMB version used the Win10, Samba is a Unix program that emulates SMB.> > > Protocol version - 3.1.1 (same on both > connections) Command used - smbstatus > > The smb config file on the Linux server is also attached.This list strips attachments, so can you post the smb.conf inline. Rowland
Ralph Boehme
2022-Apr-07 12:22 UTC
[Samba] A disconnected network can, for all practical purposes, hang your system.
On 4/7/22 10:17, Jaideep Shankar via samba wrote:> Result: P2 does not get lock, returns 'EACCES' instantaneously, tried > for around an hour.maybe something this help: socket options = TCP_NODELAY SO_KEEPALIVE TCP_KEEPCNT=5 TCP_KEEPIDLE=60 TCP_KEEPINTVL=5 -slow -- Ralph Boehme, Samba Team https://samba.org/ SerNet Samba Team Lead https://sernet.de/en/team-samba -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 840 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/samba/attachments/20220407/8e6099ef/OpenPGP_signature.sig>