[jcifs] [PATCH] DC restart => DC List empty

Waldheim, Frank F.Waldheim at ing-diba.de
Wed Oct 25 14:48:41 GMT 2006


hi there,
we found a problem with the logic in SMBSession which selects the DC to
be queried.
in a situation where all configured DCs are rebooted one after another
the dc-list
would end up empty and will not be refreshed until expired. 
we set a loop around the lookup which will do an immediate expire in
case no
suitable DC was found. to prevent a infinite loop the fail-over retries
are
limited to two - this could be adjusted to any more usefull value.
we hope that is a good idea.
-fw


--- jcifs_1.2.9/src/jcifs/smb/SmbSession.java	2006-04-05
20:45:18.000000000 +0200
+++ jcifs-1.2.9-rm/src/jcifs/smb/SmbSession.java	2006-10-24
14:20:59.000000000 +0200
@@ -89,6 +89,10 @@
             throw new SmbException( "A domain was not specified" );
         }
         synchronized (DOMAIN) {
+
//-----------------------------------------------------------------
+          // START: Bugfix DC restart: 2 loops to reload dc list if
necessary
+          for(int loop=0; loop<2; loop++ ) {
+
//-----------------------------------------------------------------
             long now = System.currentTimeMillis();
             if (dc_list_expiration < now) {
                 dc_list_expiration = now + CACHE_POLICY * 1000L;
@@ -121,6 +125,14 @@
             }
 
             dc_list_expiration = now + 1000 * 60 * 15; /* 15 min */
+
//-----------------------------------------------------------------
+            // CONTINUE: Bugfix DC restart
+            if( SmbTransport.log.level > 1 )
+                SmbTransport.log.println( "Failed to negotiate with a
suitable domain controller, loop: " + loop );
+            dc_list_expiration = 0L ; // dc_list should expire
immediately !!!
+            // END: Bugfix DC restart: loop
+          }
+
//-----------------------------------------------------------------
         }
 
         throw new UnknownHostException(


Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail ist nicht gestattet.
 
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail
in error) please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the material in
this e-mail is strictly forbidden.
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the jcifs mailing list