Giter Club home page Giter Club logo

Comments (2)

houshengbo avatar houshengbo commented on June 9, 2024

For Python, we can use filter to log the transaction information.
One question is that transaction ID is managed as an object, which also other implemented methods besides the id itself, in openwhisk core. Do we need the same approach or just an ID?
When and how do we generate the ID, if it is not something we can directly get?

from openwhisk-package-kafka.

jberstler avatar jberstler commented on June 9, 2024

This transaction ID will be specific to the feed provider. That is, it will only be used by the feed provider and will be different from any TID created by the OpenWhisk system. Because this feed provider operates independently of the OW core, it cannot possibly obtain a TID generated by the core.

It is at our discretion about when to create new TIDs, but it should be easy to identify these situations when we consider that the purpose of the TID is to de-interleave log messages. So the first rule of TIDs is: You only need a TID when there is a potential to interleave log messages. For a counter example, I don't think that any messages logged by the "doctor" thread need a TID, because the doctor is a single thread, and can't possibly result in interleaved log messages, so long as they are properly identified as being from the doctor - which they already are 😉

Similarly, the polling loop of each Consumer is already grouped by logging the ID of the trigger. And since each Consumer runs in its own unique thread, it is not possible for messages from the same Consumer to be interleaved with each other. As such, as long as the log message includes the trigger ID, then there is no need to generate a TID for (as an example) each Consumer, or each poll() loop of each Consumer.

However, there is a need for a TID when a request to create or delete a trigger comes in. These are clearly separate "transactions" and can be interleaved. All log messages pertaining to the fulfillment of these requests should have a unique, but shared TID until each request is completed.

from openwhisk-package-kafka.

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.