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

INDY-2164: add re-sending failed msgs for clients #1260

Merged
merged 11 commits into from
Jul 17, 2019

Conversation

Toktar
Copy link
Contributor

@Toktar Toktar commented Jul 8, 2019

Signed-off-by: toktar renata.toktar@dsr-corporation.com

Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
@@ -130,6 +130,7 @@ def __init__(self, name, ha, basedirpath, msgHandler, restricted=True,
self._stashed_to_disconnected = {}
self._stashed_pongs = set()
self._received_pings = set()
self._waiting_messages = dict()
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. It's better to use {} to init a new dict.
  2. How do we limit the number of items in _waiting_messages to avoid OOM?

@@ -802,6 +804,26 @@ def transmit(self, msg, uid, timeout=None, serialized=False):
return False, err_str

def transmitThroughListener(self, msg, ident) -> Tuple[bool, Optional[str]]:
self._waiting_messages.setdefault(ident, [])
self._waiting_messages[ident].append(msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

You can write self._waiting_messages.setdefault(ident, []).append(msg)

result, error_msg, need_to_resend = self._transmit_one_msg_through_listener(current_msg,
ident)
if not need_to_resend:
self._waiting_messages[ident].remove(current_msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we going to remove ident from _waiting_messages if there are no more messages there?

for current_msg in list(self._waiting_messages[ident]):
result, error_msg, need_to_resend = self._transmit_one_msg_through_listener(current_msg,
ident)
if not need_to_resend:
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we going to clear all messages for a given ident after timeout?

Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
@Toktar Toktar changed the title [WIP][ci skip][INDY-2164] add re-sending failed msgs for clients INDY-2164: add re-sending failed msgs for clients Jul 17, 2019
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
stp_zmq/client_message_provider.py Show resolved Hide resolved
stp_core/config.py Outdated Show resolved Hide resolved
stp_zmq/client_message_provider.py Show resolved Hide resolved
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
@ashcherbakov ashcherbakov merged commit cee9e78 into hyperledger:master Jul 17, 2019
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.

None yet

2 participants