Commit 4b4d660
authored
Fix state reverting (#298)
* fail if we get part when state is endOrError
* Prevent TaskHandler state change after `.endOrError`
Motivation:
Right now if task handler encounters an error, it changes state to
`.endOrError`. We gate on that state to make sure that we do not
process errors in the pipeline twice. Unfortunately, that state
can be reset when we upload body or receive response parts.
Modifications:
Adds state validation before state is updated to a new value
Adds a test
Result:
Fixes #2971 parent ffcd1e1 commit 4b4d660
File tree
3 files changed
+61
-3
lines changed- Sources/AsyncHTTPClient
- Tests/AsyncHTTPClientTests
3 files changed
+61
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
839 | 839 | | |
840 | 840 | | |
841 | 841 | | |
842 | | - | |
843 | 842 | | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
844 | 848 | | |
845 | 849 | | |
846 | | - | |
847 | 850 | | |
848 | 851 | | |
849 | 852 | | |
850 | 853 | | |
851 | 854 | | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
852 | 859 | | |
853 | 860 | | |
854 | 861 | | |
| |||
924 | 931 | | |
925 | 932 | | |
926 | 933 | | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
927 | 938 | | |
928 | 939 | | |
929 | 940 | | |
| |||
940 | 951 | | |
941 | 952 | | |
942 | 953 | | |
943 | | - | |
| 954 | + | |
944 | 955 | | |
945 | 956 | | |
946 | 957 | | |
| |||
952 | 963 | | |
953 | 964 | | |
954 | 965 | | |
| 966 | + | |
| 967 | + | |
955 | 968 | | |
956 | 969 | | |
957 | 970 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1119 | 1119 | | |
1120 | 1120 | | |
1121 | 1121 | | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
1122 | 1166 | | |
0 commit comments