pingcap / failpoint

An implementation of failpoints for Golang.
Apache License 2.0
817 stars 63 forks source link

Failpoints.Disable not remove failpath from fps.reg #80

Open gerayking opened 1 year ago

gerayking commented 1 year ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error. I'm trying to iterate over failpoint.List() to obtain all the enabled failpoint keys. However, I'm also retrieving deprecated keys from the list.
  2. What did you expect to see? After calling failpoint.disable(key), the key should no longer be present in fps.reg
  3. What did you see instead? Now, even after I disable a failpoint key, I can still retrieve it once it has been enabled.4. Versions of the failpoint

    • failpoint-ctl version (run failpoint-ctl -V):

      (paste failpoint-ctl version here)
      ReleaseVersion None
      BuildTS None
      GitHash None
      GitBranch None
      GoVersion None
gerayking commented 1 year ago

I managed to address the issue by using failpoint.status(fppath). However, I'm unclear about the status of the failpoints returned by failpoint.List(). Does it show failpoints that are defined, enabled, or disabled?