connections.tdb & messages.tdb getting full of junk (FIXED - Patch enclosed)

Richard Bollinger rabollinger at home.com
Mon Jan 8 21:11:24 GMT 2001


Here are the fixes for connections.tdb not getting properly cleaned out
under normal circumstances...

First, in smbd/server.c, we need to delete the entry added for every smbd
process:

--- ../source/smbd/server.c Tue Nov 28 07:15:34 2000
+++ ./smbd/server.c Mon Jan  8 14:47:58 2001
@@ -426,6 +426,11 @@

  conn_close_all();

+ /* delete our entry in the connections database. */
+ if (lp_status(-1)) {
+  yield_connection(NULL,"",MAXSTATUS);
+ }
+
     respond_to_all_remaining_local_messages();

 #ifdef WITH_DFS


Next, in smbd/connection.c, we need to fix the key for this call as in
claim_connection():

--- ../source/smbd/connection.c Fri Dec 15 08:16:44 2000
+++ smbd/connection.c Mon Jan  8 15:52:27 2001
@@ -55,7 +55,7 @@

  ZERO_STRUCT(key);
  key.pid = sys_getpid();
- if (conn) key.cnum = conn->cnum;
+ key.cnum = conn?conn->cnum:-1;
  fstrcpy(key.name, name);

  kbuf.dptr = (char *)&key;


Rich Bollinger, Elliott Company

----- Original Message -----
From: "Damian Ivereigh" <damian at cisco.com>
To: <samba-technical at us5.samba.org>
Sent: Friday, January 05, 2001 1:56 AM
Subject: connections.tdb & messages.tdb getting full of junk


> Hi guys,
>
> Just in case you aren't bored of me yet....
>
> When running smbd under heavy load, not to mention doing a few
> killall's when installing new versions, the connections.tdb &
> messages.tdb get full of junk which never seems to get cleaned out.
> This causes a problem when a broadcast is done, because random process
> (non-Samba) get sent SIGUSR1's (where the pid has been re-used). This
> causes quite a bit of havoc!
>
> I am wondering what everyone's thoughts are on this? Am I doing
> something stupid? My temporary (rather cludgy fix) is just add an
> extra check in traverse_fn() (lib/messages.c) for the pid existing and
> if not delete the record from connections.tdb. What I am concerned
> about is whether it is OK to do a tdb_delete from within a
> tdb_traverse. Also will this "cleanup" be called frequently enough?
> Does have anyone have any thoughts on the "proper" way to keep this
> table clean? Should there be a seperate cleanup process for example -
> are there any race conditions to think of etc?
>
> Damian
>
>
> --
> Damian Ivereigh
> CEPS Team Lead
> http://wwwin-print.cisco.com
> Desk: +61 2 8446 6344
> Mob: +61 418 217 582
>
>





More information about the samba-technical mailing list