dreedyman / Rio

Rio is an open source technology that provides a dynamic architecture for developing, deploying and managing distributed systems composed of services.
Apache License 2.0
21 stars 17 forks source link

Groovy-based serviceDiscoveryTimeout configuration not applied to AssociationDescriptor #14

Closed dreedyman closed 11 years ago

dreedyman commented 11 years ago

A fault-tolerant ("uses", eagerly-injected with a serviceDiscoveryTimeout) association, defined as follows:

association(type: "uses", serviceType: JavaSpace05.name, property: "javaSpace", name: "Workflow Space") { management inject: 'eager', serviceDiscoveryTimeout: 1, serviceDiscoveryTimeUnits: 'minutes' }

Is accepted for deployment (does not fail validation) but does not set the service discovery timeout, as seen in the logging output of associations:

FINEST: [New Worker] AssociationManagement descriptors=1 Type=AssociationType=uses, Name=Workflow Space, Interfaces=net.jini.space.JavaSpace05, Groups=Workflow, MatchOnName=true, OperationalString=, Property=javaSpace, associationMatchFilter=null, proxyClass=null, proxyType=jdk, serviceStrategyClass=org.rioproject.associations.strategy.FailOver, lazyInject=false, serviceDiscoveryTimeout=0, serviceDiscoveryTimeUnits=MINUTES, FDH=org.rioproject.fdh.AdminFaultDetectionHandler Feb 23, 2012 9:30:00 PM org.rioproject.associations.AssociationMgmt$AssociationHandler

The slightly different syntax indicated in the Rio documentation (http://www.rio-project.org/associations.html#Proxy_Failure_Modes), repeated here for brevity:

association(type: 'uses', name: 'Foo', property: 'foo') { management strategy: Utilization.name serviceDiscoveryTimeout: 5 }

Is also accepted for deployment, and does also not configure a serviceDiscoveryTimeout.

**Note: Marked as a critical bug, because all indications are that my configuration attempts are correct. I would love to be proven wrong.

dreedyman commented 11 years ago

Behavior has been fixed and tested with AssociationManagementSettingsTest in rio-lib. The corresponding syntax is as follows: associations { association(name: 'Add', type: 'requires', property: 'add') { management inject: 'eager', proxy: "net.foo.space.SomeProxy", strategy: 'org.rioproject.associations.strategy.Utilization', serviceDiscoveryTimeout: 15, serviceDiscoveryTimeoutUnits: TimeUnit.SECONDS } }

An integration test still needs to be written that will verify injection happens as intended.

dreedyman commented 11 years ago

Test case has been provided