Please help in knowing the funtionality of 'deadtime' parameter

Richard Sharpe realrichardsharpe at gmail.com
Sun Dec 4 20:16:08 UTC 2016


On Sun, Dec 4, 2016 at 11:49 AM, sandeep nag <sandeepnagamalli at gmail.com> wrote:
> Please help in getting some insight on below mentioned email.
>
> On Sun, Dec 4, 2016 at 5:49 PM, sandeep nag <sandeepnagamalli at gmail.com>
> wrote:
>
>> I am on samba source 3.6.25 and I see the connections are not getting
>> released though I set
>> 1. autoodisconnect as 1 minute on windows client
>> 2. deadtime = 2 in smb.conf
>>
>> When I debugged the issue I found that:
>> In conn_idle_all() function:
>>  if (sconn->using_smb2) {
>> 298         /* SMB2 */
>> 299         struct smbd_smb2_session *sess;
>> 300         for (sess = sconn->smb2.sessions.list; sess; sess =
>> sess->next) {
>> 301             struct smbd_smb2_tcon *ptcon;
>> 302
>> 303             for (ptcon = sess->tcons.list; ptcon; ptcon = ptcon->next)
>> {
>> 304                 time_t age;
>> 305                 connection_struct *conn = ptcon->compat_conn;
>> 306
>> 307                 if (conn == NULL) {
>> 308                     continue;
>> 309                 }
>> 310
>> 311                 age = t - conn->lastused;
>> 312                 /* close dirptrs on connections that are idle */
>> 313                 if (age > DPTR_IDLE_TIMEOUT) {
>> 314                     dptr_idlecnum(conn);
>> 315                 }
>> 316
>> 317                 if (conn->num_files_open > 0 || age < deadtime) {
>> <---
>> 318                     return false;
>> 319                 }
>> 320             }
>> 321         }
>> 322     }
>>
>>
>> conn->num_files_open in line#317 is non zero.
>> I have two questions:
>> 1. Is their any other parameter which I could use in conjunction with
>> deadtime, which has to be used, in order to get it work. any workaround?
>> 2. In the link, https://lists.samba.org/archive/samba/2006-April/
>> 119652.html
>> suggested a code present in the attachment snippet.txt, should I try
>> adding this patch, will that lead to anyother side effect?
>>
>> Thanks in advance, for your time.

This is a very old version of Samba. However, if the clients are
holding files open, even though they are idle (perhaps because they
have a change-notify request outstanding) then dead time is not going
to help.

Perhaps in your case you don't want that conn->num_file_open > 0
above, but I would caution you to test it thoroughly with real
customer workloads.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)



More information about the samba-technical mailing list