Skip to content

Commit

Permalink
Ensure SWF domain gets created before attempting to reference the dom…
Browse files Browse the repository at this point in the history
…ain with live workers.
  • Loading branch information
Joe Sondow committed Oct 25, 2013
1 parent a0597ae commit bac2681
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 4 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
1.3.1

Bug Fix
- Fixed critical error for new Asgard installations that lack an existing Config.groovy file
Bug Fixes
- Fixed startup error for new Asgard installations that lack an existing Config.groovy file
- Fixed startup error for AWS accounts that don't yet have an asgard SWF domain


1.3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,12 @@ class AwsSimpleWorkflowService implements CacheInitializer, InitializingBean {

// Workflow Domains

private List<DomainInfo> retrieveDomainsAndEnsureDomainIsRegistered() {
/**
* Gets all the SWF domains and registers the main domain we need if it's not already in the list.
*
* @return info objects for all the registered domains in the default region
*/
List<DomainInfo> retrieveDomainsAndEnsureDomainIsRegistered() {
log.debug('Retrieve workflow domains')
ListDomainsRequest request = new ListDomainsRequest(registrationStatus: 'REGISTERED')
List<DomainInfo> domains = domainFetcher.retrieve(Region.defaultRegion(), request)
Expand Down
6 changes: 6 additions & 0 deletions grails-app/services/com/netflix/asgard/FlowService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import org.springframework.beans.factory.InitializingBean
class FlowService implements InitializingBean {

def awsClientService
def awsSimpleWorkflowService
def configService
def idService
DeploymentActivitiesImpl deploymentActivitiesImpl
Expand All @@ -61,6 +62,11 @@ class FlowService implements InitializingBean {
] as Map)

void afterPropertiesSet() {

// Ensure that the domain has been registered before attempting to reference it with workers. This code runs
// before cache filling begins.
awsSimpleWorkflowService.retrieveDomainsAndEnsureDomainIsRegistered()

String domain = configService.simpleWorkflowDomain
String taskList = configService.simpleWorkflowTaskList
GlobalWorkflowAttributes.taskList = taskList
Expand Down

0 comments on commit bac2681

Please sign in to comment.