Commit c7d6521
authored
Fix stream accounting bug when stream close leads to connection close (#1603)
Motivation:
The connection pool manager manages a pool of connections per
event-loop. It spreads load across these pools by tracking how many
streams a pool has capacity for and how many streams are in use. To
facilitate this each pool reports back to the pool manager when streams
have been reserved and when they have been returned.
If connections are closed unexpectedly (due to an error, for example)
then the pool reports this in bulk. However when the streams are closed
they are also reported back to the pool manager. This means the manager
can end up thinking a pool has a negative number of reserved streams
which results in an assertion failure.
Modifications:
- Check if the connection a stream is being returned to is available
before reporting stream closures to the pool manager.
Result:
- Better stream accounting.
- Resolved #15981 parent 345dd6e commit c7d6521
File tree
3 files changed
+52
-3
lines changed- Sources/GRPC/ConnectionPool
- Tests/GRPCTests/ConnectionPool
3 files changed
+52
-3
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
704 | | - | |
705 | | - | |
706 | | - | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
879 | 923 | | |
880 | 924 | | |
881 | 925 | | |
| |||
0 commit comments