Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the Object from the serviceMethodCache again #4126

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

Endeavour233
Copy link

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
Author

This resolves #4113

@Endeavour233
Copy link
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
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
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