Skip to content

Check the Object from the serviceMethodCache again#4126

Open
Endeavour233 wants to merge 2 commits intosquare:trunkfrom
Endeavour233:checkInstanceOfServiceMethod
Open

Check the Object from the serviceMethodCache again#4126
Endeavour233 wants to merge 2 commits intosquare:trunkfrom
Endeavour233:checkInstanceOfServiceMethod

Conversation

@Endeavour233
Copy link
Copy Markdown

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
Copy link
Copy Markdown
Author

This resolves #4113

@Endeavour233
Copy link
Copy Markdown
Author

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

@JakeWharton
Copy link
Copy Markdown
Collaborator

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.

@Endeavour233
Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants