Skip to content

Don't cache the notification proxy service #25

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

Merged
merged 2 commits into from
Sep 29, 2017

Conversation

TsvetanMilanov
Copy link
Contributor

When we execute awaitNotification and there is no response we will wait to
receive something from the notification proxy service socket. If we execute it
again while we are waiting the response from the first call we will start
waiting for response on the same socket. If only one response comes in the
socket one of the calls will get it and the other one will continue
waiting. To avoid this we should not cache the notification proxy service
(the socket). This way each call will start new service and wait for response
on different socket.

We had problems on some devices when we start new service for every call
before we started to use the ios-device-lib. That's why we want to disable
the cache only for the notification service proxy.

Tests with 500 postNotification invocations:

  • there are no repeating sockets
  • sending messages to each socket returns correct bytes sent count

There is also a workaround which will not fix the problem but it will make
it harder to reproduce. We can implement timeout in receive_message method
and this way we will wait for response only for 1 second for example. The bug
will appear only if we execute awaitNotification two times in 1 second.

When we execute awaitNotification and there is no response we will wait to
receive something from the notification proxy service socket. If we execute it
again while we are waiting the response from the first call we will start
waiting for response on the same socket. If only one response comes in the
socket one of the calls will get it and the other one will continue
waiting. To avoid this we should not cache the notification proxy service
(the socket). This way each call will start new service and wait for response
on different socket.

We had problems on some devices when we start new service for every call
before we started to use the ios-device-lib. That's why we want to disable
the cache only for the notification service proxy.

Tests with 500 postNotification invocations:
- there are no repeating sockets
- sending messages to each socket returns correct bytes sent count

There is also a workaround which will not fix the problem but it will make
it harder to reproduce. We can implement timeout in receive_message method
and this way we will wait for response only for 1 second for example. The bug
will appear only if we execute awaitNotification two times in 1 second.
Copy link
Contributor

@Mitko-Kerezov Mitko-Kerezov left a comment

Choose a reason for hiding this comment

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

Looks okay to me

@TsvetanMilanov TsvetanMilanov merged commit 5756a5d into master Sep 29, 2017
@TsvetanMilanov TsvetanMilanov deleted the milanov/do-not-cache-the-notification-service branch September 29, 2017 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants