Skip to content

Add workaround for https://issuetracker.google.com/issues/63649622 - #3624

Merged
yschimke merged 2 commits into
lysine-dev:masterfrom
datayja:hotfix/android-o-platform-bug-63649622
Sep 25, 2017
Merged

yschimke merged 2 commits into
lysine-dev:masterfrom
datayja:hotfix/android-o-platform-bug-63649622

Conversation

@datayja

@datayja datayja commented Sep 23, 2017

Copy link
Copy Markdown
Contributor

This fixes #3438

} catch (ClassCastException e) {
// On android 8.0, socket.connect throws a ClassCastException due to a bug
if (Build.VERSION.SDK_INT == 26) {
log(WARN, "Swallowed ClassCastException, see https://issuetracker.google.com/issues/63649622", e);

@yschimke yschimke Sep 23, 2017 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without seeing this exact Android code, it seems hard to review. But I don't think this is correct based on previous versions. It seems like the CCE is thrown while processing a root IOException. I'm basing this on connectDetail always going into an Exception.

At minimum swallowing only seems correct if the connect is successful, and then the CCE is thrown during routine logging. The Google bug mentions this likely being related to sockets cancelled on another thread. Ultimately it may not matter as the next IO operation is likely to fail, but it would be better if we get the state right at the end of this method.

I suspect the correct fix is rethrowing as an IOException.

@JakeWharton do you know anyone who could check the exact state after this exception?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tl;dr: rethrowing the exception as IOException seems about right.

@yschimke
yschimke merged commit aed2224 into lysine-dev:master Sep 25, 2017
@swankjesse

Copy link
Copy Markdown
Collaborator

Nice. Thank you!

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Android O CastException

3 participants