Giter Club home page Giter Club logo

Comments (7)

enocom avatar enocom commented on May 10, 2024 1

There's some question of where this responsibility belongs.

Insofar as implementation, sync.RWMutex works and maybe even a sync.Mutex too. Just depends where the hot paths may be.

from agones.

markmandel avatar markmandel commented on May 10, 2024

@enocom mind if I edit this ticket to include the full details? Just in case anyone else happens to want to pick this up? (Unless you want to expand this out, since I know you had ideas)

from agones.

enocom avatar enocom commented on May 10, 2024

@markmandel Please do. I think this issue might be good for first-time contributors, too.

from agones.

markmandel avatar markmandel commented on May 10, 2024

Some interesting notes here:

  • The health check handler is passed in here
  • The actual goroutines are run in the workerqueue. so there is likely opportunity to standardise this across anything that uses a workerqueue.

Final thought - for a readiness check, readiness can be turned on as soon as the WebHook that powers the MutationWebhookConfiguration is ready

from agones.

markmandel avatar markmandel commented on May 10, 2024

@enocom did you have some thoughts on how you were thinking of tracking if the goroutines were still active? (or maybe a PR 😁 )

from agones.

enocom avatar enocom commented on May 10, 2024

I imagine adding a Registrar, which in functionality would be similar to a sync.WaitGroup. We pass the Registrar to anything that starts a goroutine and upon starting the goroutine, we maybe call registrar.Inc() with a corresponding defer registrar.Dec() for when the goroutine exits. Then the liveness check could simply query the Registrar to see if all registered goroutines are still running.

Thoughts?

from agones.

markmandel avatar markmandel commented on May 10, 2024

Works for me. Although the Inc(), Dec() and Count() would need to be threadsafe. I'm assuming a sync.RWMutex ?

Thought - would this be part of a Registrar, or maybe just part of the WorkerQueue?

from agones.

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.