retrofit icon indicating copy to clipboard operation
retrofit copied to clipboard

Check the Object from the serviceMethodCache again

Open Endeavour233 opened this issue 1 year ago • 4 comments

I wrote a test annotationParsingFailureObservedByMultipleWaitingThreads() (modified from @JakeWharton 's annotationParsingFailureObservedByWaitingThreads) in RetrofitTest.java to mock the situation I mentioned in #4114 . And I found that the code in base:trunk branch does failed the test and throw a ClassCastException (3 failures out of 10 test attempts) 截屏2024-04-11 20 52 45

This pull request tries to deal with this extreme situation. To verify it, I have ran the test case for 20 times and all succeeded.

Endeavour233 avatar Apr 11 '24 13:04 Endeavour233

This resolves #4113

Endeavour233 avatar Apr 12 '24 00:04 Endeavour233

Excuse me, do you have any plan about this PR? (I am good with closing it because it's intended to deal with a pretty extreme situation, and we can replace the whole method with computeIfAbsent in the future) Thank you. @JakeWharton

Endeavour233 avatar Apr 23 '24 15:04 Endeavour233

I will get to it eventually, but probably not for a few weeks, unfortunately. Don't worry, it has been sitting in my notifications and won't get lost.

JakeWharton avatar Apr 23 '24 15:04 JakeWharton

I will get to it eventually, but probably not for a few weeks, unfortunately. Don't worry, it has been sitting in my notifications and won't get lost.

Thanks for your response. Then I'll leave it open. Thank you.

Endeavour233 avatar Apr 23 '24 15:04 Endeavour233