Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add context to KV descriptor methods #1569

Open
ondrej-fabry opened this issue Nov 21, 2019 · 1 comment
Open

Add context to KV descriptor methods #1569

ondrej-fabry opened this issue Nov 21, 2019 · 1 comment

Comments

@ondrej-fabry
Copy link
Member

ondrej-fabry commented Nov 21, 2019

Add ctx context.Context as first parameter to KV descriptor methods and remove key string. Context provides propagation of request context starting from clients (grpc) and up to calls to remote services (govpp) helping to provide a lot of insight for developers.

Context in KV descriptor methods could be possibly used to:

  • lookup info about the value:
    • object key (this could replace key parameter)
    • parent value (for derived values)
  • lookup details about the current transaction (relevant TODO comment in link_state descriptor of VPP/ifplugin)
  • make it possible to trace requests for their entire lifespan inside agent - drastically improving tracing capabilities
    (e.g. incoming gRPC req -> KVscheduler TX -> KVdescriptor CRUD -> SB impl (vppcalls..) -> 3rd-party )libs
  • lookup info about:
    • client initiating the request?
    • object metadata?
    • source of data?
    • ... ?
  • extend validation capabilities: e.g. check if IP address is already in use by other interfaces
  • ... ?
@ondrej-fabry ondrej-fabry changed the title Context parameter for KV descriptors Add context to KV descriptor methods Feb 11, 2020
@ondrej-fabry ondrej-fabry pinned this issue Feb 21, 2020
@ondrej-fabry ondrej-fabry unpinned this issue Oct 15, 2020
@ondrej-fabry ondrej-fabry pinned this issue Nov 27, 2020
@milanlenco milanlenco self-assigned this Dec 3, 2020
@milanlenco
Copy link
Collaborator

Will start working on this in parallel with my main tasks since the need to have some context in descriptor just keeps reappearing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants