Skip to content

Commit

Permalink
Plugin provider atp race condition (#172)
Browse files Browse the repository at this point in the history
* Progress towards adding function expressions to the engine

* Added function support

* Fixes.

* Added workflow test cases with more complex expressions

* Addressed review feedback

* Remove unnecessary reference to the function names in descriptions

* More description changes

* Manually add special cases to prevent platform-specific behavior

* Added negative zeros to test cases

* Address review comments

* Change case

* Address review comments

* Address review comments

* Fix linting error and address review comment.

* Change descriptions for functions

* Address review comment

* Added namespaced scopes for step namespaces in input

* Use default namespace constant

* Apply scopes from sub-workflows

* Update invalid serialization detector for changes in SDK

* Fix linting errors

* Improved code and added initial tests for namespaced scopes

* Added unit tests for new ApplyScope functions

* Added integration tests for namespaced scoped workflows

* Added namespaces for referenced items in scopes

* Upgrade to go SDK pre-release

* Addressed review comments

* Clarify stage IDs in comment examples

* Addressed review comments

* Fixed race condition for atp client field

* Move instantiation out of locked region
  • Loading branch information
jaredoconnell authored Apr 17, 2024
1 parent 1a8ccf7 commit 5c54a86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/step/plugin/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,12 @@ func (r *runningStep) deployStage() (deployer.Plugin, error) {

func (r *runningStep) startStage(container deployer.Plugin) error {
r.logger.Debugf("Starting stage for step %s/%s", r.runID, r.pluginStepID)
atpClient := atp.NewClientWithLogger(container, r.logger)
r.lock.Lock()
previousStage := string(r.currentStage)
r.currentStage = StageIDStarting
inputRecievedEarly := false
r.atpClient = atpClient

var runInput any
select {
Expand Down Expand Up @@ -940,7 +942,6 @@ func (r *runningStep) startStage(container deployer.Plugin) error {
return fmt.Errorf("step closed while waiting for run configuration")
}
}
r.atpClient = atp.NewClientWithLogger(container, r.logger)

inputSchema, err := r.atpClient.ReadSchema()
if err != nil {
Expand Down

0 comments on commit 5c54a86

Please sign in to comment.