Changeset 5847


Ignore:
Timestamp:
Feb 27, 2020, 9:34:25 AM (3 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1226: More thread deadlocks

I hope this can fix the deadlock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/Reggie.java

    r5843 r5847  
    494494  public static XmlConfig reloadConfig()
    495495  {
    496     synchronized (configLock)
    497     {
    498       loadConfig(true);
    499       ActivityLog.getInstance().reloadConfig();
    500       CounterService.getInstance().reloadConfig();
    501     }
     496    loadConfig(true);
     497    ActivityLog.getInstance().reloadConfig();
     498    CounterService.getInstance().reloadConfig();
    502499    return rootConfig;
    503500  }
     
    641638        }
    642639       
     640      }
     641      catch (Exception ex)
     642      {
     643        logger.error("Could not load configuration", ex);
     644        throw new RuntimeException(ex);
     645      }
     646      finally
     647      {
     648        FileUtil.close(is);
     649      }
     650    }
     651   
     652    if (reloadConfig == null)
     653    {
     654      // Create and register an event handler that re-load the Reggie configuration
     655      // whenever a SERVICE_STARTED event is sent for the Open Grid Service
     656      Registry registry = Application.getExtensionsManager().getRegistry();
     657      synchronized (registry)
     658      {
    643659        if (reloadConfig == null)
    644660        {
    645           // Create and register an event handler that re-load the Reggie configuration
    646           // whenever a SERVICE_STARTED event is sent for the Open Grid Service
    647           Registry registry = Application.getExtensionsManager().getRegistry();
    648661          reloadConfig = new ReloadConfigEventHandler();
    649662          EventFilter whenOpenGridServiceStarted = new ExtensionEventFilter("net.sf.basedb.opengrid.service", Services.SERVICE_STARTED);
    650663          registry.registerEventHandler(reloadConfig, whenOpenGridServiceStarted, Reggie.class.getClassLoader());
    651664        }
    652        
    653       }
    654       catch (Exception ex)
    655       {
    656         logger.error("Could not load configuration", ex);
    657         throw new RuntimeException(ex);
    658       }
    659       finally
    660       {
    661         FileUtil.close(is);
    662665      }
    663666    }
Note: See TracChangeset for help on using the changeset viewer.