Skip to content

Commit

Permalink
fix: fixed memory leak & race issues
Browse files Browse the repository at this point in the history
* a memory leak with recycled *Result in schema_props.go was causing
  some invalid results when GC is under pressure (seen on go-swagger test)
  * refactored schema props to isolate anyOf, oneOf, allOf, etc.
    * made the validation logic a little clearer to follow
  * fixed leaks with unreleased allocated Results
  * added test for go-swagger fixture #2866, which exhibits the failure
    with the highest probability
  * ensured that child validators for schemaPropsValidator cannot be
    reused after they are exhausted

* with go1.22, the race detector figured a race condition when expanding
  the swagger schema for parameters (spec.go)
  * fix: before iterating over parameters to validate the swagger schema for
    a parameter, deep clone the schema from the root spec. This is
    performed once for a spec, so the perf impact should be negligible

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
  • Loading branch information
fredbi committed Feb 28, 2024
1 parent 630d556 commit 908a79b
Show file tree
Hide file tree
Showing 7 changed files with 9,762 additions and 164 deletions.

0 comments on commit 908a79b

Please sign in to comment.