Maximum Session IDs

Tommy Wu newsletter at teatime.com.tw
Thu Dec 6 05:18:03 GMT 2001


Andrew Bartlett <abartlet at pcug.org.au> wrote:

> Shut down Samba, delete /var/locks/samba/sessionid.tdb. 
> Try to reproduce.

   I've the same problem with samba 2.2.x (all I've tried from 2.2.1).
   I've only 3 client here, but after one day, the session id will over 3000... :-(
 
> Turn up the log level, and give me a some logs of the code just before
> it thinks its out of sessionids.

   I add some debug code to session_claim() and session_yield() to mark a session allocate
   and session release.
   
   I found when I running a Win2000 server as samba client...
   It'll request a new session id for a few seconds like

[2001/12/06 20:52:55, 1] smbd/session.c:session_claim(93)
  session_claim: allocate ID: 1
[2001/12/06 20:52:55, 1] smbd/service.c:make_connection(610)
  teatime-dc (192.168.0.10) connect to service BBS_SYS as user bbs (uid=1001, gid=1000) (pid 19408)
[2001/12/06 20:53:00, 1] smbd/session.c:session_claim(93)
  session_claim: allocate ID: 2
[2001/12/06 20:53:00, 1] smbd/service.c:make_connection(610)
  teatime-dc (192.168.0.10) connect to service BBS_SYS as user bbs (uid=1001, gid=1000) (pid 19408)
[2001/12/06 20:53:02, 1] smbd/session.c:session_claim(93)
  session_claim: allocate ID: 3
[2001/12/06 20:53:02, 1] smbd/service.c:make_connection(610)
  bbs (192.168.0.129) connect to service BBS_SYS as user bbs (uid=1001, gid=1000) (pid 19423)
[2001/12/06 20:53:03, 1] smbd/service.c:close_cnum(650)
  teatime-dc (192.168.0.10) closed connection to service BBS_SYS
  
There is only one client here, should only one session id here I think.
But for a few seconds, a win2000 server smbclient request a new session id..
So the session id will run over the limit (3000).

When I kill the process in smbstatus (only one process)...
All session id will release like this:

[2001/12/06 21:01:26, 1] smbd/session.c:session_yield(148)
  session_yield: release ID: 50
[2001/12/06 21:01:26, 1] smbd/session.c:session_yield(148)
  session_yield: release ID: 49
[2001/12/06 21:01:26, 1] smbd/session.c:session_yield(148)
  session_yield: release ID: 48
[2001/12/06 21:01:26, 1] smbd/session.c:session_yield(148)
  session_yield: release ID: 47
[2001/12/06 21:01:26, 1] smbd/session.c:session_yield(148)
  session_yield: release ID: 46
[2001/12/06 21:01:26, 1] smbd/session.c:session_yield(148)
  session_yield: release ID: 2

   I'm using Debian woody now. for kernel 2.4.2 to 16 with reiserfs and xfs.
    (with or without smp) All will get the same problem here.

  Attach file is a samba log for log level = 10.

  I current patch the samba source to disable session_claim() and session_yield().
  This seems work fine here.... (I'm not sure there is any other problem without 
  these two functions...)

-- 

    Tommy Wu
    mailto:tommy at teatime.com.tw
    http://www.teatime.com.tw/~tommy
    ICQ: 22766091
    Mobile Phone: +886 936 909490
    TeaTime BBS +886 2 31515964 24Hrs V.Everything

-------------- next part --------------
A non-text attachment was scrubbed...
Name: log.smbd.debug.bz2
Type: application/octet-stream
Size: 23720 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba/attachments/20011206/da175d19/log.smbd.debug.obj


More information about the samba mailing list