[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] locking bug



Hi there,

Just a thought: what if you modified SessionInfo.timeout(Object) like this:

   public final void timeout(Object userData) {
      synchronized (this.EXPIRY_TIMER_MONITOR) {
         this.timerKey = null;
         log.warning(ME+": Session timeout for " + getLoginName() + " occurred, session '" + getSecretSessionId() + "' is expired, autologout");
      }
      DisconnectQosServer qos = new DisconnectQosServer(glob);
      qos.deleteSubjectQueue(true);
      try {
         glob.getAuthenticate().disconnect(getAddressServer(), getSecretSessionId(), qos.toXml());
      } catch (XmlBlasterException e) {
         log.severe(ME+": Internal problem with disconnect: " + e.toString());
      }
   }

It seems as if timerKey is protected by EXPIRY_TIMER_MONITOR elsewhere, but not here (this might be an error). I simply removed the locking of "lock" from the method. Does this make it thread-unsafe? :)

regards,
Balázs