Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

What happens when a pod disappears #7

Open
robertgzr opened this issue Jul 25, 2017 · 2 comments
Open

What happens when a pod disappears #7

robertgzr opened this issue Jul 25, 2017 · 2 comments
Milestone

Comments

@robertgzr
Copy link
Contributor

  • do we have to do anything to "clean up" after the bpf program?
  • keep the metrics?
@robertgzr robertgzr added this to the 0.1.0 milestone Jul 25, 2017
@robertgzr
Copy link
Contributor Author

/cc @alban @iaguis

@alban
Copy link

alban commented Jul 25, 2017

Your daemon can read the metrics from the bpf maps a last time. The daemon should still have the file descriptors of the bpf maps open. Then, you can close the module used for that cgroup:

https://github.com/iovisor/gobpf/blob/36406ec/elf/module.go#L540-L550

// Close takes care of terminating all underlying BPF programs and structures.
// That is:
//
// * Closing map file descriptors and unpinning them where applicable
// * Detaching BPF programs from kprobes and closing their file descriptors
// * Closing cgroup-bpf file descriptors
// * Closing socket filter file descriptors
//
// It doesn't detach BPF programs from cgroups or sockets because they're
// considered resources the user controls.
// It also doesn't unpin pinned maps. Use CloseExt and set Unpin to do this.
func (b *Module) Close() error {

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

No branches or pull requests

2 participants