-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed memory pools & race issues
* fixes * 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 * ensured that child validators for schemaPropsValidator cannot be reused after they are exhausted * ensured that recyclable results are redeemed in all cases in default and example validators * with go1.22, the race detector figured a race condition when expanding the swagger schema for parameters (spec.go) * 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 * tests * added test for go-swagger fixture #2866, which exhibits the failure with the highest probability * added a debug version of the pools (build with the "validatedebug" build tag) to assert more thorough checks of the correctness of the pools usage Signed-off-by: Frederic BIDON <[email protected]>
- Loading branch information
Showing
20 changed files
with
11,116 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.