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

connmgr: add nowatchdog go build tag #1666

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

birros
Copy link
Contributor

@birros birros commented Aug 3, 2022

Add the ability to disable watchdog even if cgo is enabled.

I logicaly tested the configuration using a truth table to cover each case:

p q p∧¬q ¬p∨q (p∧¬q)⊕(¬p∨q)
T T F T T
T F T F T
F T F T T
F F F T T

Where:

  • p: cgo tag
  • q: nowatchdog tag
  • p∧¬q: watchdog_cgo.go compiled if true
  • ¬p∨q: watchdog_no_cgo.go compiled if true
  • (p∧¬q)⊕(¬p∨q): only one of these files is compiled if true

Usage (for newbies)

$ go build -tags nowatchdog .

Additionnal note

This fixes an old problem I reported a few months ago: libp2p/go-libp2p-connmgr#98.

I couldn't find a convention to write a deactivation tag, so I added the no prefix to watchdog but if you have a better proposal you're welcome.

Add the capacity to disable watchdog even if cgo is present.
@marten-seemann marten-seemann changed the title build(connmgr): add nowatchdog go build tag connmgr: add nowatchdog go build tag Aug 3, 2022
@marten-seemann marten-seemann merged commit 68722aa into libp2p:master Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants