Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Catch a rare timing crash. #245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Catch a rare timing crash. #245

wants to merge 1 commit into from

Conversation

Tolriq
Copy link

@Tolriq Tolriq commented Jun 30, 2014

No description provided.

@akarimova
Copy link
Contributor

Hi @Tolriq,
have you found the source of the issue?

@Tolriq
Copy link
Author

Tolriq commented Jul 10, 2014

Hard to reproduce but it seems this is caused by a concurrency of the service being bind and the timeout triggering making the service unbinded during the calling of onServiceConnected.

@akarimova is it possible to have some feedback on all the other PR ?

Since my production library is now quite patched to get stability and if you refuse the PR I'll need to organize myself a little differently and see how to handle future patches (That will be needed for Android L for example since InApp needs some changes for it.)

context.unbindService(this);
try {
context.unbindService(this);
} catch (Exception ignore) {
Copy link

Choose a reason for hiding this comment

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

handle your exceptions.

What happens if the unbinding fails? What reasons could it fail for?

Throw a more specific exception?

Copy link
Author

Choose a reason for hiding this comment

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

Since their was absolutely no interest from the openIAB team to work on all the bugs and PR I do not maintain anymore my PRs.

Anyway as explained in the description, this is a very rare collision where the service is already unbinded by the timeout so will fail for this second unbind.
There's nothing to handle, do or rethrow. You can eventually be more specific on the Exception catch if you want but in all cases there's no possible recovery on any error on this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants