Commit 663c505
authored
core: normalize service config number values (grpc#12826)
This updates default service config validation to accept numeric values
represented as `Number`, not only `Double`.
Common JSON parsers may deserialize integer-looking JSON values such as
`maxAttempts: 4` and `backoffMultiplier: 2` as `Integer`, which
previously caused `defaultServiceConfig()` to fail with
`IllegalArgumentException`.
The values are normalized to `Double` when copied into the validated
service config, preserving the existing internal representation expected
by the service config parsing code.
Fixes grpc#128151 parent 10d901d commit 663c505
2 files changed
Lines changed: 27 additions & 5 deletions
File tree
- core/src
- main/java/io/grpc/internal
- test/java/io/grpc/internal
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
585 | | - | |
586 | | - | |
| 585 | + | |
| 586 | + | |
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
610 | | - | |
| 609 | + | |
| 610 | + | |
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
| |||
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
| 738 | + | |
738 | 739 | | |
739 | 740 | | |
740 | | - | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
741 | 763 | | |
742 | 764 | | |
743 | 765 | | |
| |||
0 commit comments