Skip to content

Commit

Permalink
[core] Make StfB/StfS-to-FLP maps local for each request
Browse files Browse the repository at this point in the history
  • Loading branch information
teo committed Jul 26, 2024
1 parent 75999d7 commit 093e9f7
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions core/integration/ddsched/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ type Plugin struct {
ddSchedulerHost string
ddSchedulerPort int

stfbHostIdMap map[string]string //map[task_id]ib_hostname
stfsHostIdMap map[string]string

ddSchedClient *RpcClient
}

Expand All @@ -83,8 +80,6 @@ func NewPlugin(endpoint string) integration.Plugin {
return &Plugin{
ddSchedulerHost: u.Hostname(),
ddSchedulerPort: portNumber,
stfbHostIdMap: nil,
stfsHostIdMap: nil,
ddSchedClient: nil,
}
}
Expand Down Expand Up @@ -242,8 +237,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
}
root := workflow.GetRoot(parentRole)

p.stfbHostIdMap = make(map[string]string)
p.stfsHostIdMap = make(map[string]string)
stfbHostIdMap := make(map[string]string)
stfsHostIdMap := make(map[string]string)

workflow.LeafWalk(root, func(role workflow.Role) {
roleVS, err := role.ConsolidatedVarStack()
Expand All @@ -262,9 +257,9 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
ddDiscoveryStfsId, ddDiscoveryStfsIdOk = roleVS["dd_discovery_stfs_id"]
if ddDiscoveryIbHostnameOk {
if ddDiscoveryStfsIdOk {
p.stfsHostIdMap[ddDiscoveryStfsId] = ddDiscoveryIbHostname
stfsHostIdMap[ddDiscoveryStfsId] = ddDiscoveryIbHostname
} else if ddDiscoveryStfbIdOk {
p.stfbHostIdMap[ddDiscoveryStfbId] = ddDiscoveryIbHostname
stfbHostIdMap[ddDiscoveryStfbId] = ddDiscoveryIbHostname
} else {
return
}
Expand All @@ -288,8 +283,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
EnvironmentId: envId,
PartitionId: envId,
},
StfbHostIdMap: p.stfbHostIdMap,
StfsHostIdMap: p.stfsHostIdMap,
StfbHostIdMap: stfbHostIdMap,
StfsHostIdMap: stfsHostIdMap,
PartitionParams: partitionParams,
}

Expand Down

0 comments on commit 093e9f7

Please sign in to comment.