@@ -183,7 +183,7 @@ func (p *Plugin) GetConnectionState() string {
183183
184184func (p * Plugin ) queryPartitionStatus () {
185185 defer utils .TimeTrackFunction (time .Now (), log .WithPrefix ("odcclient" ))
186- ctx , cancel := context . WithTimeout ( context . Background (), ODC_STATUS_TIMEOUT )
186+ ctx , cancel := integration . NewContextEmptyEnvIdRunType ( ODC_STATUS_TIMEOUT )
187187 defer cancel ()
188188
189189 statusRep := & odc.StatusReply {}
@@ -238,7 +238,7 @@ func (p *Plugin) queryPartitionStatus() {
238238 go func (idx int , partId uid.ID ) {
239239 defer wg .Done ()
240240
241- ctx , cancel := context . WithTimeout ( context . Background (), ODC_STATUS_TIMEOUT )
241+ ctx , cancel := integration . NewContextEmptyEnvIdRunType ( ODC_STATUS_TIMEOUT )
242242 defer cancel ()
243243
244244 odcPartStateRep , err := p .odcClient .GetState (ctx , & odc.StateRequest {
@@ -1179,7 +1179,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
11791179
11801180 timeout := callable .AcquireTimeout (ODC_PARTITIONINITIALIZE_TIMEOUT , varStack , "PartitionInitialize" , envId )
11811181
1182- ctx , cancel := context . WithTimeout ( context . Background () , timeout )
1182+ ctx , cancel := integration . NewContext ( envId , varStack , timeout )
11831183 defer cancel ()
11841184
11851185 err = handleRun (ctx , p .odcClient , isManualXml , map [string ]string {
@@ -1292,7 +1292,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
12921292 }
12931293 }
12941294
1295- ctx , cancel := context . WithTimeout ( context . Background () , timeout )
1295+ ctx , cancel := integration . NewContext ( envId , varStack , timeout )
12961296 defer cancel ()
12971297 err := handleConfigure (ctx , p .odcClient , arguments , paddingTimeout , envId , call )
12981298 if err != nil {
@@ -1314,7 +1314,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
13141314
13151315 callFailedStr := "EPN Reset call failed"
13161316
1317- ctx , cancel := context . WithTimeout ( context . Background () , timeout )
1317+ ctx , cancel := integration . NewContext ( envId , call . VarStack , timeout )
13181318 defer cancel ()
13191319 err := handleReset (ctx , p .odcClient , nil , paddingTimeout , envId , call )
13201320 if err != nil {
@@ -1343,7 +1343,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
13431343
13441344 callFailedStr := "EPN PartitionTerminate call failed"
13451345
1346- ctx , cancel := context . WithTimeout ( context . Background () , timeout )
1346+ ctx , cancel := integration . NewContext ( envId , varStack , timeout )
13471347 defer cancel ()
13481348 err := handlePartitionTerminate (ctx , p .odcClient , nil , paddingTimeout , envId , call )
13491349 if err != nil {
@@ -1414,7 +1414,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
14141414 arguments ["original_run_number" ] = originalRunNumber
14151415 }
14161416
1417- ctx , cancel := context . WithTimeout ( context . Background () , timeout )
1417+ ctx , cancel := integration . NewContext ( envId , varStack , timeout )
14181418 defer cancel ()
14191419 err = handleStart (ctx , p .odcClient , arguments , paddingTimeout , envId , runNumberu64 , call )
14201420 if err != nil {
@@ -1462,7 +1462,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
14621462
14631463 timeout := callable .AcquireTimeout (ODC_STOP_TIMEOUT , varStack , "Stop" , envId )
14641464
1465- ctx , cancel := context . WithTimeout ( context . Background () , timeout )
1465+ ctx , cancel := integration . NewContext ( envId , varStack , timeout )
14661466 defer cancel ()
14671467 err = handleStop (ctx , p .odcClient , arguments , paddingTimeout , envId , runNumberu64 , call )
14681468 if err != nil {
@@ -1486,7 +1486,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
14861486
14871487 timeout := callable .AcquireTimeout (ODC_STOP_TIMEOUT , varStack , "EnsureStop" , envId )
14881488
1489- ctx , cancel := context . WithTimeout ( context . Background () , timeout )
1489+ ctx , cancel := integration . NewContext ( envId , varStack , timeout )
14901490 defer cancel ()
14911491
14921492 state , err := handleGetState (ctx , p .odcClient , envId )
@@ -1551,7 +1551,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
15511551
15521552 callFailedStr := "EPN EnsureCleanup call failed"
15531553
1554- ctx , cancel := context . WithTimeout ( context . Background () , timeout )
1554+ ctx , cancel := integration . NewContext ( envId , varStack , timeout )
15551555 defer cancel ()
15561556 err := handleCleanup (ctx , p .odcClient , nil , paddingTimeout , envId , call )
15571557 if err != nil {
@@ -1572,7 +1572,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
15721572
15731573 callFailedStr := "EPN PreDeploymentCleanup call failed"
15741574
1575- ctx , cancel := context . WithTimeout ( context . Background () , timeout )
1575+ ctx , cancel := integration . NewContext ( envId , varStack , timeout )
15761576 defer cancel ()
15771577 err := handleCleanup (ctx , p .odcClient , nil , paddingTimeout , "" , call )
15781578 if err != nil {
@@ -1593,7 +1593,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
15931593
15941594 callFailedStr := "EPN EnsureCleanupLegacy call failed"
15951595
1596- ctx , cancel := context . WithTimeout ( context . Background () , timeout )
1596+ ctx , cancel := integration . NewContext ( envId , varStack , timeout )
15971597 defer cancel ()
15981598 err := handleCleanupLegacy (ctx , p .odcClient , nil , paddingTimeout , envId , call )
15991599 if err != nil {
0 commit comments