GithubHelp home page GithubHelp logo

ActivityManager tuneup about kernel_gateway HOT 3 CLOSED

parente avatar parente commented on August 31, 2024
ActivityManager tuneup

from kernel_gateway.

Comments (3)

Lull3rSkat3r avatar Lull3rSkat3r commented on August 31, 2024

In regards to ignore growing endlessly: That was implemented to prevent kernels coming back into the activity list, albeit a naive solution. You can see this problem when a kernel is shutdown and then a client disconnects.

The easiest way I can see to solve this is when kernels are added/deleted to the list the ActivityManager syncs with the list of kernels in the KernelManager. If there is a kernel in the ActivityManager which is not in the KernelManager it should be removed.

from kernel_gateway.

parente avatar parente commented on August 31, 2024

Yep. Understand why ignore exists. Just need to garbage collect it. Checking the kernel manager makes sense. Once the AcitivityManager is like the other managers and shared via settings / constructors, it'll be easy for one to ref the other.

from kernel_gateway.

parente avatar parente commented on August 31, 2024

Paired with @Lull3rSkat3r on the last two items. We agreed to leave things alone for the time being.

Instead of checking kg_list_kernels everywhere that calls ActivityManager methods, just check it in the ActivityManager instance itself. (Easy once it gets instantiated in the gatewayapp and can get the settings.)

Moving all the checking logic into the activity manager still creates a tight binding between the notebook API and activity tracking. Only a pub/sub bus would really disentangle the two, and that seems overkill for the moment.

Calls to the activity manager should probably happen after the action takes place in case it fails.

After looking at the code again, we settled on the mantra that activity values should be updated when there's intent from a client or a kernel, regardless of whether the action actually completes or not. As it stands, we recognize that the CONNECTIONS count from clients to a kernel can get out of sync if errors occur. We intend to treat that value as approximate for the time being until we receive feedback from users on how all this metadata winds up getting used. For example, if all that needs to be known is whether one or more clients is connected, but not the exact count, the timestamps are enough assuming the clients are sending proper heartbeats.

from kernel_gateway.

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.