Skip to content

Commit

Permalink
commit cfe9ed6b2f83133a0e3449284d6c4cb8746fecdf
Browse files Browse the repository at this point in the history
Author: Neil Soman <neil@eucalyptus.com>
Date:   Sat Mar 29 10:23:13 2014 -0700

    Fixes to Walrus backend to throw specific exceptions, instead of EucalyptusCloudException. Added new exception types.

    EUCA-8998

commit 8e46b66
Author: Swathi Gangisetty <swathi@eucalyptus.com>
Date:   Fri Mar 28 18:56:20 2014 -0700

    Add last modified timestamp to complete multipart upload response from Walrus.
    Use the last modified timestamp from the backend when available.
    Format last modified timestamp in copy response correctly in the provider clients.

    Fixes EUCA-8945

commit 354dd31
Author: Zach Hill <zach@eucalyptus.com>
Date:   Fri Mar 28 18:53:04 2014 -0700

    Changed walrus->walrusbackend in property config. Fixes EUCA-8993

commit 44ddd7a
Merge: 579db84 e7fdbbd
Author: Evan Thomas <ethomas@eucalyptus.com>
Date:   Fri Mar 28 17:56:05 2014 -0700

    Merge branch 'dev/ethomas/EUCA-7686-2' into testing

commit 579db84
Merge: e2d0912 37d8ade
Author: Sang-Min Park <smpark.uva@gmail.com>
Date:   Fri Mar 28 16:22:28 2014 -0700

    Merge branch 'dev/spark/EUCA-8976' into testing

commit e2d0912
Author: Matt Clark <mclark@eucalyptus.com>
Date:   Fri Mar 28 16:12:38 2014 -0700

    Add retries and better debug to part download. Remove sig from part url debugEUCA-8989. Fixes EUCA-8996, EUCA-8966

commit 37d8ade
Author: Sang-Min Park <smpark.uva@gmail.com>
Date:   Fri Mar 28 14:40:46 2014 -0700

    EUCA-8976: don't attempt to remove IP mapping more than once

commit e7fdbbd
Merge: cdf71a0 ce0657d
Author: Evan Thomas <ethomas@eucalyptus.com>
Date:   Thu Mar 27 14:12:12 2014 -0700

    Merge branch 'testing' into dev/ethomas/EUCA-7686-2

commit cdf71a0
Author: Evan Thomas <ethomas@eucalyptus.com>
Date:   Wed Mar 26 16:06:47 2014 -0700

    EUCA-7686 added some listeners with type checking for webservice properties

commit f08765b
Author: Evan Thomas <ethomas@eucalyptus.com>
Date:   Wed Mar 26 14:57:42 2014 -0700

    EUCA-7686 Put changes in (used compareAndSet() and changed log levels to .trace() as per reviewer comments), and put the isRunnable.false() in a finally block so errors in restart() would not block)

commit 2f887a4
Author: Evan Thomas <ethomas@eucalyptus.com>
Date:   Tue Mar 25 22:49:48 2014 -0700

    EUCA-7686
       Removed hard coded port 443 for netty server.
       Discovered many PropertyChangeListeners silently fail.  Wrote logging code against that (PropertyChangeListeners)
       Discovered Webservices.restart() has issues being called in the change listener thread, created a polling mechanism to
       call WebServices.restart() if certain properties have changed.  (Those that had the RestartWebserviceListener as the
       propertyChangeListener).
       These last few points allow the bootstrap.webservices.port property to "eventually" work (within 1 minute).
  • Loading branch information
Neil Soman committed Mar 29, 2014
1 parent d9763d7 commit b805247
Show file tree
Hide file tree
Showing 30 changed files with 760 additions and 397 deletions.
Expand Up @@ -34,6 +34,7 @@
import com.eucalyptus.component.Topology;
import com.eucalyptus.component.id.Eucalyptus;
import com.eucalyptus.entities.Entities;
import com.eucalyptus.entities.TransactionResource;
import com.eucalyptus.event.ClockTick;
import com.eucalyptus.event.EventListener;
import com.eucalyptus.event.Listeners;
Expand Down Expand Up @@ -112,7 +113,20 @@ public void apply(DeleteLoadbalancerEvent evt)
if(address==null || address.length()<=0)
continue;
try{
EucalyptusActivityTasks.getInstance().removeARecord(dns.getZone(), dns.getName(), address);
EucalyptusActivityTasks.getInstance().removeARecord(dns.getZone(), dns.getName(), address);
try ( final TransactionResource db =
Entities.transactionFor(LoadBalancerServoInstance.class)){
try{
final LoadBalancerServoInstance entity =
Entities.uniqueResult(LoadBalancerServoInstance.named(instance.getInstanceId()));
entity.setDnsState(LoadBalancerServoInstance.DNS_STATE.Deregistered);
Entities.persist(entity);
db.commit();
}catch(final Exception ex){
LOG.error(String.format("failed to set servo instance(%s)'s dns state to deregistered",
instance.getInstanceId()), ex);
}
}
}catch(Exception ex){
LOG.error(String.format("failed to remove dns a record (zone=%s, name=%s, address=%s)",
dns.getZone(), dns.getName(), address), ex);
Expand Down Expand Up @@ -448,51 +462,56 @@ public void fireEvent(ClockTick event) {

if(retired == null || retired.size()<=0)
return;

/// for each:
final List<LoadBalancerServoInstance> retiredAndDnsClean = Lists.newArrayList();
for(final LoadBalancerServoInstance instance: retired){
/// make sure DNS is deregistered
if(LoadBalancerServoInstance.DNS_STATE.Deregistered.equals(instance.getDnsState()))
retiredAndDnsClean.add(instance);
}
/// for each:
// describe instances
final List<String> param = Lists.newArrayList();
final Map<String, String> latestState = Maps.newHashMap();
for(final LoadBalancerServoInstance instance : retired){
/// call describe instance
String instanceId = instance.getInstanceId();
if(instanceId == null)
continue;
param.clear();
param.add(instanceId);
String instanceState = null;
try{
final List<RunningInstancesItemType> result =
EucalyptusActivityTasks.getInstance().describeSystemInstances(param);
if (result.isEmpty())
instanceState= "terminated";
else
instanceState = result.get(0).getStateName();
}catch(final Exception ex){
LOG.warn("failed to query instances", ex);
continue;
}
latestState.put(instanceId, instanceState);
}
final List<String> param = Lists.newArrayList();
final Map<String, String> latestState = Maps.newHashMap();
for(final LoadBalancerServoInstance instance : retiredAndDnsClean){
/// call describe instance
String instanceId = instance.getInstanceId();
if(instanceId == null)
continue;
param.clear();
param.add(instanceId);
String instanceState = null;
try{
final List<RunningInstancesItemType> result =
EucalyptusActivityTasks.getInstance().describeSystemInstances(param);
if (result.isEmpty())
instanceState= "terminated";
else
instanceState = result.get(0).getStateName();
}catch(final Exception ex){
LOG.warn("failed to query instances", ex);
continue;
}
latestState.put(instanceId, instanceState);
}

// if state==terminated or describe instances return no result,
// delete the database record
for(String instanceId : latestState.keySet()){
String state = latestState.get(instanceId);
if(state.equals("terminated")){
final EntityTransaction db2 = Entities.get( LoadBalancerServoInstance.class );
try{
LoadBalancerServoInstance toDelete = Entities.uniqueResult(LoadBalancerServoInstance.named(instanceId));
Entities.delete(toDelete);
db2.commit();
}catch(Exception ex){
db2.rollback();
}finally {
if(db2.isActive())
db2.rollback();
}
}
}
for(String instanceId : latestState.keySet()){
String state = latestState.get(instanceId);
if(state.equals("terminated")){
final EntityTransaction db2 = Entities.get( LoadBalancerServoInstance.class );
try{
LoadBalancerServoInstance toDelete = Entities.uniqueResult(LoadBalancerServoInstance.named(instanceId));
Entities.delete(toDelete);
db2.commit();
}catch(Exception ex){
db2.rollback();
}finally {
if(db2.isActive())
db2.rollback();
}
}
}
}
}
}
Expand Up @@ -64,9 +64,12 @@

import com.eucalyptus.configurable.PropertyDirectory.NoopEventListener;
import com.google.common.collect.Constraint;
import org.apache.log4j.Logger;


public class PropertyChangeListeners {


public static final Logger LOG = Logger.getLogger(PropertyChangeListener.class);
public static void applyConstraint( final Object newValue, final Constraint<Object>... constraints ) throws ConfigurablePropertyException {
for ( final Constraint<Object> testNewValue : constraints ) {
try {
Expand Down Expand Up @@ -118,6 +121,8 @@ public static PropertyChangeListener getListenerFromClass( Class<? extends Prope
try {
changeListener = changeListenerClass.newInstance( );
} catch ( Throwable e ) {
LOG.error("Can't set listener to " + changeListenerClass);
LOG.error(e, e);
changeListener = NoopEventListener.NOOP;
}
} else {
Expand Down
Expand Up @@ -89,7 +89,7 @@
public class StackConfiguration extends AbstractPersistent {

@ConfigurableField( description = "Channel connect timeout (ms).",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckNonNegativeIntegerAndRestartWebServicesListener.class )
public static Integer CHANNEL_CONNECT_TIMEOUT = 500;
@ConfigurableField( changeListener = TimeChangeListener.class,
description = "Time interval duration (in seconds) during which duplicate signatures will be accepted to accomodate collisions for legitimate requests inherent in Query/REST signing protocol." )
Expand All @@ -98,52 +98,52 @@ public class StackConfiguration extends AbstractPersistent {
changeListener = TimeChangeListener.class )
public static Integer CLOCK_SKEW_SEC = 20;
@ConfigurableField( description = "Server socket reuse address.",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckBooleanAndRestartWebServicesListener.class )
public static final Boolean SERVER_CHANNEL_REUSE_ADDRESS = true;
@ConfigurableField( description = "Server socket TCP_NODELAY.",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckBooleanAndRestartWebServicesListener.class )
public static final Boolean SERVER_CHANNEL_NODELAY = true;
@ConfigurableField( description = "Socket reuse address.",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckBooleanAndRestartWebServicesListener.class )
public static final Boolean CHANNEL_REUSE_ADDRESS = true;
@ConfigurableField( description = "Socket keep alive.",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckBooleanAndRestartWebServicesListener.class )
public static final Boolean CHANNEL_KEEP_ALIVE = true;
@ConfigurableField( description = "Server socket TCP_NODELAY.",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckBooleanAndRestartWebServicesListener.class )
public static final Boolean CHANNEL_NODELAY = true;
@ConfigurableField( description = "Server worker thread pool max.",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckNonNegativeIntegerAndRestartWebServicesListener.class )
public static Integer SERVER_POOL_MAX_THREADS = 128;
@ConfigurableField( description = "Server max worker memory per connection.",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckNonNegativeLongAndRestartWebServicesListener.class )
public static Long SERVER_POOL_MAX_MEM_PER_CONN = 0L;
@ConfigurableField( description = "Server max worker memory total.",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckNonNegativeIntegerAndRestartWebServicesListener.class )
public static Long SERVER_POOL_TOTAL_MEM = 0L;

@ConfigurableField( description = "Service socket select timeout (ms).",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckNonNegativeLongAndRestartWebServicesListener.class )
public static Long SERVER_POOL_TIMEOUT_MILLIS = 500L;

@ConfigurableField( description = "Server selector thread pool max.",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckNonNegativeIntegerAndRestartWebServicesListener.class )
public static Integer SERVER_BOSS_POOL_MAX_THREADS = 128;

@ConfigurableField( description = "Server max selector memory per connection.",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckNonNegativeLongAndRestartWebServicesListener.class )
public static Long SERVER_BOSS_POOL_MAX_MEM_PER_CONN = 0L;

@ConfigurableField( description = "Server worker thread pool max.",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckNonNegativeLongAndRestartWebServicesListener.class )
public static Long SERVER_BOSS_POOL_TOTAL_MEM = 0L;

@ConfigurableField( description = "Service socket select timeout (ms).",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckNonNegativeLongAndRestartWebServicesListener.class )
public static Long SERVER_BOSS_POOL_TIMEOUT_MILLIS = 500L;

@ConfigurableField( description = "Port to bind (note: port 8773 is always bound regardless).",
changeListener = WebServices.RestartWebServicesListener.class )
changeListener = WebServices.CheckNonNegativeIntegerAndRestartWebServicesListener.class )
public static Integer PORT = 8773;
public static final Integer INTERNAL_PORT = 8773;

Expand Down

0 comments on commit b805247

Please sign in to comment.