Bug 10615 - libsmbclient doesn't handle disconnects properly
Summary: libsmbclient doesn't handle disconnects properly
Status: RESOLVED DUPLICATE of bug 11079
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 4.1.7
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-18 08:18 UTC by Ross Lagerwall
Modified: 2015-03-18 16:42 UTC (History)
3 users (show)

See Also:


Attachments
test program (1.05 KB, text/x-csrc)
2014-05-18 08:18 UTC, Ross Lagerwall
no flags Details
test output (26.36 KB, text/plain)
2014-05-18 08:20 UTC, Ross Lagerwall
no flags Details
samba server conf (10.42 KB, text/plain)
2014-05-18 08:21 UTC, Ross Lagerwall
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Lagerwall 2014-05-18 08:18:49 UTC
Created attachment 9948 [details]
test program

libsmbclient doesn't handle if the connection to the server is terminated.

I have attached a test program that demonstrates the issue with an idle disconnect; basically, it does smbc_stat(); sleep(130); smbc_stat(); smbc_stat(). The first and third stat()s succeed, the second fails with ECONNABORTED. It would be nice if libsmbclient could reconnect internally for the second stat().

I have attached the test program, the output and the samba server's conf (note deadtime = 1 to force idle disconnects).

Thanks!
Comment 1 Ross Lagerwall 2014-05-18 08:20:26 UTC
Created attachment 9949 [details]
test output
Comment 2 Ross Lagerwall 2014-05-18 08:21:00 UTC
Created attachment 9950 [details]
samba server conf
Comment 3 Garrett Mitchener 2015-03-13 15:52:11 UTC
This has significant user interface consequences in GNOME:

What I see bad behavior in Deja Dup, which is a backup program that can store backups to Windows shares. It runs automatically at night, and if I happen to have mounted the shared drive where it stores stuff before I leave work, I arrive the next morning and see a "software caused connection abort" error message and the backup has failed. I think what's happening is that the server times out, and the connection doesn't recover gracefully.

I found this bug report

https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1321354

which suggests running a script to look at the gvfs mounts every 5 minutes.  This works -- I think it keeps the server from timing out, and my backups are working without an error as long as the script is running.  It greatly improves the responsiveness of Nautilus as well.

Related: https://bugzilla.gnome.org/show_bug.cgi?id=578139
Comment 4 Jeremy Allison 2015-03-18 16:42:30 UTC
Ok, I'm merging this one with 11079.

That bug has a proposed patch attached. Let's coordinate on that bug report and work though the issues there.

Jeremy.

*** This bug has been marked as a duplicate of bug 11079 ***