Giter VIP home page Giter VIP logo

Comments (3)

christophd avatar christophd commented on June 14, 2024

From what I saw in the error output lately I think this is due to racing conditions on parallel running cobra commands (cobra may not be able to handle this concurrency)

fatal error: concurrent map writes
  
  goroutine 2121 [running]:
  github.com/spf13/viper.(*Viper).BindFlagValue(0xc0004b2700, {0xc000dd4fa0?, 0x9?}, {0x2e36910, 0xc000e72b40})
  	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/viper.go:1247 +0x67
  github.com/spf13/viper.(*Viper).BindPFlag(0x27b33fc?, {0xc000dd4fa0?, 0x2e05458?}, 0x2e05458?)
  	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/viper.go:1224 +0x2d
  github.com/spf13/viper.BindPFlag(...)
  	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/viper.go:1218
  github.com/apache/camel-k/v2/pkg/cmd.bindPFlags.func1(0xc000e72b40)
  	/home/runner/work/camel-k/camel-k/pkg/cmd/util.go:85 +0xe6
  github.com/spf13/pflag.(*FlagSet).VisitAll(0xc001872400?, 0xc00122b7f8)
  	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/flag.go:290 +0xec
  github.com/apache/camel-k/v2/pkg/cmd.bindPFlags(0xc000ef3800?)
  	/home/runner/work/camel-k/camel-k/pkg/cmd/util.go:80 +0x9c
  github.com/apache/camel-k/v2/pkg/cmd.bindPFlagsHierarchy(0x2674b40?)
  	/home/runner/work/camel-k/camel-k/pkg/cmd/util.go:64 +0xbb
  github.com/apache/camel-k/v2/pkg/cmd.kamelPostAddCommandInit(0xc00[1960](https://github.com/apache/camel-k/actions/runs/8093110281/job/22115080943#step:4:2033)000?)
  	/home/runner/work/camel-k/camel-k/pkg/cmd/root.go:96 +0x2b
  github.com/apache/camel-k/v2/pkg/cmd.NewKamelCommand({0x2e35288, 0xc000334af0})

The test uses a go routine to run a kamel CLI command in --dev mode and while the goroutine is cancelled with defered func call the next tests already starts and this may cause concurrent writes to map in cobra/viper.

I thought maybe to gracefully terminate the go routine by sending a SIGTERM signal to the process that kills the kamel CLI --dev mode when the test is run?

from camel-k.

squakez avatar squakez commented on June 14, 2024

If it's not too much work then we can do something, otherwise I'd push towards camel k run --dev which should not have the same problem I hope.

from camel-k.

squakez avatar squakez commented on June 14, 2024

I think this is stable now. Closing.

from camel-k.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.