Commit c2224b1
fix(retry): drop Retry.java; revert createBody bracket per r3206778779
Three changes:
(1) Retry.java is folded into Http.RetryInterceptor as package-private
static members (MAX_RETRY, DEFAULT_RETRY_UNIT_MS, DEFAULT_RETRY_CAP_MS,
MAX_JITTER, RETRYABLE_HTTP_STATUS_CODES, isHttpStatusRetryable,
isRequestErrorRetryable, exponentialBackoffMs). The class was a one-use
container for the interceptor's helpers; folding shrinks the package
surface. RetryTest call sites updated to Http.RetryInterceptor.X.
(2) BaseS3Client.createBody save/restore bracket dropped (r3206778779,
"It is not needed for Java"). For the file-PUT paths that go through
MinioAsyncClient, the upstream brackets at L1995/L3540 leave the file
pointer at start-of-payload, and the pre-computed Checksum.makeHeaders
headers short-circuit every Checksum.update guard inside createBody --
so the pointer never moves there. Http.RequestBody.writeTo seeks to
the captured start-of-payload on every attempt, so the retry
interceptor's repeated writeTo calls replay the same bytes. createBody
is now byte-identical to master.
(3) Checksum.java reverted to master form. The positional
FileChannel.read(ByteBuffer, long) variant added in 93e4f47 exists
only to make the bracket in createBody redundant; once the bracket is
gone, the variant is no longer needed and Checksum.update returns to
the master file.read(buf, off, len) form. MinioAsyncClient L1995/L3540
brackets remain (they match master verbatim).
Empirical validation -- two new tests in RetryTest:
- testRetryWithFileBody_replaysSameBytesOnEveryAttempt: 8 KiB random
payload, MockWebServer queue 503/503/503/200; asserts 4 PUT requests
recorded and each body is byte-identical to the original payload.
- testRetryWithFileBody_transportFailureReplaysFromStart: 4 KiB
payload, DISCONNECT_AT_START followed by 200; asserts the retry
attempt's body matches the original payload after seek-back.
:api:check (compile + spotless + spotbugs + 30 RetryTest cases) PASS
:api:javadoc PASS
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 93e4f47 commit c2224b1
6 files changed
Lines changed: 273 additions & 172 deletions
File tree
- api/src
- main/java/io/minio
- test/java/io/minio
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 107 | | |
121 | 108 | | |
122 | 109 | | |
123 | 110 | | |
124 | 111 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 112 | + | |
132 | 113 | | |
133 | 114 | | |
134 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
| |||
611 | 617 | | |
612 | 618 | | |
613 | 619 | | |
614 | | - | |
615 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
616 | 623 | | |
617 | 624 | | |
618 | | - | |
| 625 | + | |
619 | 626 | | |
620 | 627 | | |
621 | 628 | | |
| |||
736 | 743 | | |
737 | 744 | | |
738 | 745 | | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
739 | 820 | | |
740 | 821 | | |
741 | | - | |
| 822 | + | |
742 | 823 | | |
743 | | - | |
| 824 | + | |
744 | 825 | | |
745 | 826 | | |
746 | 827 | | |
| |||
769 | 850 | | |
770 | 851 | | |
771 | 852 | | |
772 | | - | |
| 853 | + | |
773 | 854 | | |
774 | 855 | | |
775 | 856 | | |
| |||
791 | 872 | | |
792 | 873 | | |
793 | 874 | | |
794 | | - | |
| 875 | + | |
795 | 876 | | |
796 | 877 | | |
797 | 878 | | |
798 | 879 | | |
799 | | - | |
| 880 | + | |
800 | 881 | | |
801 | 882 | | |
802 | 883 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
1993 | 1993 | | |
1994 | 1994 | | |
1995 | 1995 | | |
| 1996 | + | |
1996 | 1997 | | |
| 1998 | + | |
1997 | 1999 | | |
1998 | 2000 | | |
1999 | 2001 | | |
| |||
2013 | 2015 | | |
2014 | 2016 | | |
2015 | 2017 | | |
| 2018 | + | |
| 2019 | + | |
2016 | 2020 | | |
2017 | 2021 | | |
2018 | 2022 | | |
| |||
3540 | 3544 | | |
3541 | 3545 | | |
3542 | 3546 | | |
| 3547 | + | |
3543 | 3548 | | |
| 3549 | + | |
3544 | 3550 | | |
3545 | 3551 | | |
| 3552 | + | |
| 3553 | + | |
3546 | 3554 | | |
3547 | 3555 | | |
3548 | 3556 | | |
| |||
This file was deleted.
0 commit comments