Re: [devel] [PATCH 1/1] osaf: return new takeover_request immediately [#3098]

2019-10-10 Thread Tran Thuan
Hi Gary,

ACK from me.

Best Regards,
ThuanTr

-Original Message-
From: Gary Lee  
Sent: Thursday, October 10, 2019 11:01 AM
To: hans.nordeb...@ericsson.com; minh.c...@dektech.com.au;
thang.d.ngu...@dektech.com.au; thuan.t...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net; Gary Lee 
Subject: [PATCH 1/1] osaf: return new takeover_request immediately [#3098]

If a takeover_request is created just before the active controller calls
'watch takeover_request', then it's possible that the active rded instance
is not informed of the request.

When 'watch takeover_request' is called, check if there's already a
takeover_request in 'NEW' state and return immediately.
---
 src/osaf/consensus/plugins/etcd3.plugin | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/osaf/consensus/plugins/etcd3.plugin
b/src/osaf/consensus/plugins/etcd3.plugin
index d926885..4e09ef6 100644
--- a/src/osaf/consensus/plugins/etcd3.plugin
+++ b/src/osaf/consensus/plugins/etcd3.plugin
@@ -337,13 +337,22 @@ watch() {
   orig_value=$(get "$watch_key")
   result=$?
 
-  if [ "$result" -le "1" ]; then
+  if [ "$result" -le 1 ]; then
+  if [ "$result" -eq 0 ] && [ "$watch_key" == "$takeover_request" ];
then
+state=$(echo $orig_value | awk '{print $4}')
+if [ "$state" == "NEW" ]; then
+  # takeover_request already exists; maybe it was written created
+  # while this node was being promoted
+  echo $orig_value
+  return 0
+fi
+  fi
 while true
 do
   sleep $heartbeat_interval
   current_value=$(get "$watch_key")
   result=$?
-  if [ "$result" -gt "1" ]; then
+  if [ "$result" -gt 1 ]; then
 # etcd down?
 if [ "$watch_key" == "$takeover_request" ]; then
   hostname=`cat $node_name_file`
--
2.7.4




___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0/2] Review Request for msg: fully support SC absence [#3083]

2019-10-10 Thread Jones, Alex
Summary: msg: fully support SC absence [#3083]
Review request for Ticket(s): 3083
Peer Reviewer(s): Mathi
Pull request to:
Affected branch(es): develop
Development branch: ticket-3083
Base revision: cafbc5d02c90b57c7c94a7735ce8e002224b3d6b
Personal repository: git://git.code.sf.net/u/trguitar/review


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n

NOTE: Patch(es) contain lines longer than 80 characers

Comments (indicate scope for each "y" above):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision 73bfecb33e36f2aa655cf1b4ca1cdce129a9d49f
Author:Alex Jones 
Date:Thu, 10 Oct 2019 12:12:06 -0400

msg: fully support SC absence [#3083]

Fix whitespace issues



revision df201a92c7ee97203e1c8ae23fb85120a04a2e6b
Author:Alex Jones 
Date:Thu, 10 Oct 2019 11:56:22 -0400

msg: fully support SC absence [#3083]

Make changes to msgnd, msgd, the agent, and tests to fully support SC
absence.



Complete diffstat:
--
 src/msg/agent/mqa_api.cc   |  103 +-
 src/msg/agent/mqa_dl_api.h |4 +
 src/msg/agent/mqa_init.cc  |6 +-
 src/msg/agent/mqa_mds.cc   |  125 +-
 src/msg/apitest/msgtest.h  |5 +
 src/msg/apitest/test_CapacityThresholds.cc |  124 +-
 src/msg/apitest/test_LimitGet.cc   |  340 ++-
 src/msg/apitest/tet_mqa.c  | 4149 ++--
 src/msg/apitest/tet_mqa_conf.c |  890 +-
 src/msg/apitest/tet_mqa_conf.h |   30 +-
 src/msg/apitest/tet_mqsv.h |4 +-
 src/msg/common/mqsv_asapi.c|4 +-
 src/msg/msgd/mqd_saf.c |  160 ++
 src/msg/msgnd/mqnd_db.h|8 -
 src/msg/msgnd/mqnd_evt.c   |  213 +-
 src/msg/msgnd/mqnd_init.c  |1 -
 src/msg/msgnd/mqnd_mds.c   |   45 +-
 src/msg/msgnd/mqnd_proc.c  |   35 +-
 src/msg/msgnd/mqnd_util.c  |   12 +-
 19 files changed, 2935 insertions(+), 3323 deletions(-)


Testing Commands:
-
1) run msgtest on a payload while stopping and starting the controllers


Testing, Expected Results:
--
1) msgtest should pass

Conditions of Submission:
-
Oct 16 or ack from developer

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.gitconfig file (i.e. user.name, user.email etc)

___ You

[devel] [PATCH 2/2] msg: fully support SC absence [#3083]

2019-10-10 Thread Jones, Alex
Fix whitespace issues
---
 src/msg/apitest/test_CapacityThresholds.cc | 2 +-
 src/msg/msgd/mqd_saf.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/msg/apitest/test_CapacityThresholds.cc 
b/src/msg/apitest/test_CapacityThresholds.cc
index eb5dda1dc..971c8ae90 100644
--- a/src/msg/apitest/test_CapacityThresholds.cc
+++ b/src/msg/apitest/test_CapacityThresholds.cc
@@ -50,7 +50,7 @@ static SaAisErrorT msgInitialize(SaMsgHandleT *msgHandle,
  SaVersionT *version)
 {
   SaAisErrorT rc(SA_AIS_OK);
-
+
   while (true) {
 rc = saMsgInitialize(msgHandle, 0, version);

diff --git a/src/msg/msgd/mqd_saf.c b/src/msg/msgd/mqd_saf.c
index 846755ba7..895a4852d 100644
--- a/src/msg/msgd/mqd_saf.c
+++ b/src/msg/msgd/mqd_saf.c
@@ -64,7 +64,7 @@ static void get_q_groups_from_imm(MQD_CB *pMqd)
 SaVersionT version = { 'A', 2, 15 };

 error = immutil_saImmOmInitialize(&immHandle, 0, &version);
-
+
 if (error != SA_AIS_OK) {
 LOG_ER("saImmOmInitialize failed %u", error);
 break;
--
2.20.1


---
Notice: This e-mail together with any attachments may contain information of 
Ribbon Communications Inc. that
is confidential and/or proprietary for the sole use of the intended recipient.  
Any review, disclosure, reliance or
distribution by others or forwarding without express permission is strictly 
prohibited.  If you are not the intended
recipient, please notify the sender immediately and then delete all copies, 
including any attachments.
---

___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0/1] Review Request for mds: add more tests for mds flow control [#3091] V3

2019-10-10 Thread thuan.tran
Summary: mds: add more tests for mds flow control [#3091]
Review request for Ticket(s): 3091
Peer Reviewer(s): Minh, Gary
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-3091
Base revision: e4c3c0c95644238fc84f31352e8ef289d9820ab4
Personal repository: git://git.code.sf.net/u/thuantr/review


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each "y" above):
-
N/A

revision 94ea409e087bd4fc8ab2d242c39c06c8e3e06250
Author: thuan.tran 
Date:   Fri, 11 Oct 2019 09:39:07 +0700

mds: add more tests for mds flow control [#3091]

mdstest for overload
- 2 senders overload one receivers
- one sender overloads 2 receivers

mdstest for SNA (Serial Number Arithmetic)
- without overload, mds sender gradually sends more than 65535 messages
  and receivers should receive them all
- with overload, mds sender sends a burst of greater than 65535 messages
  and receivers should receive them all

mdstest for #1960 backward compatibility, in order to test the txprob timer
- sender enables, receiver disables
- sender disables, receiver enables



Complete diffstat:
--
 src/mds/apitest/mdstipc.h |   6 +
 src/mds/apitest/mdstipc_api.c | 491 --
 2 files changed, 432 insertions(+), 65 deletions(-)


Testing Commands:
-
N/A

Testing, Expected Results:
--
N/A

Conditions of Submission:
-
N/A

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.gitconfig file (i.e. user.name, user.email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1/1] mds: add more tests for mds flow control [#3091]

2019-10-10 Thread thuan.tran
mdstest for overload
- 2 senders overload one receivers
- one sender overloads 2 receivers

mdstest for SNA (Serial Number Arithmetic)
- without overload, mds sender gradually sends more than 65535 messages
  and receivers should receive them all
- with overload, mds sender sends a burst of greater than 65535 messages
  and receivers should receive them all

mdstest for #1960 backward compatibility, in order to test the txprob timer
- sender enables, receiver disables
- sender disables, receiver enables
---
 src/mds/apitest/mdstipc.h |   6 +
 src/mds/apitest/mdstipc_api.c | 491 +-
 2 files changed, 432 insertions(+), 65 deletions(-)

diff --git a/src/mds/apitest/mdstipc.h b/src/mds/apitest/mdstipc.h
index 2bd44b4fa..5fd7b9c6e 100644
--- a/src/mds/apitest/mdstipc.h
+++ b/src/mds/apitest/mdstipc.h
@@ -145,6 +145,12 @@ typedef struct tet_mds_recvd_msg_info {
   uint16_t len;
 } TET_MDS_RECVD_MSG_INFO;
 
+typedef struct COUNTER {
+  MDS_DEST fr_dest;
+  uint32_t msg_count;
+  struct COUNTER *next;
+} COUNTER;
+
 /* GLOBAL variables /
 TET_ADEST gl_tet_adest;
 TET_VDEST
diff --git a/src/mds/apitest/mdstipc_api.c b/src/mds/apitest/mdstipc_api.c
index f667d7385..fec55b307 100644
--- a/src/mds/apitest/mdstipc_api.c
+++ b/src/mds/apitest/mdstipc_api.c
@@ -31,6 +31,7 @@
 
 #define MSG_SIZE MDS_DIRECT_BUF_MAXSIZE
 static MDS_CLIENT_MSG_FORMAT_VER gl_set_msg_fmt_ver;
+COUNTER *gl_head_counters = NULL;
 
 MDS_SVC_ID svc_ids[3] = {2006, 2007, 2008};
 
@@ -13105,9 +13106,63 @@ void tet_create_default_PWE_VDEST_tp()
test_validate(FAIL, 0);
 }
 
-void tet_sender(uint32_t msg_count, uint32_t msg_size)
+static void reset_counters(void)
+{
+   COUNTER *tmp = gl_head_counters;
+   while (tmp != NULL) {
+   gl_head_counters = tmp->next;
+   free(tmp);
+   tmp = gl_head_counters;
+   }
+}
+
+static uint32_t increase_counters(MDS_DEST dest)
+{
+   COUNTER *tmp = gl_head_counters;
+   while (tmp != NULL) {
+   if (tmp->fr_dest == dest) {
+   tmp->msg_count++;
+   printf("\nGot %d message from %x\n",
+   tmp->msg_count, dest);
+   return tmp->msg_count;
+   }
+   tmp = tmp->next;
+   }
+   if (tmp == NULL) {
+   COUNTER *new = (COUNTER *)malloc(sizeof(COUNTER));
+   new->fr_dest = dest;
+   new->msg_count = 1;
+   new->next = gl_head_counters;
+   gl_head_counters = new;
+   printf("\nGot %d message from %x\n",
+   new->msg_count, dest);
+   return new->msg_count;
+   }
+   return 0;
+}
+
+static bool verify_counters(uint32_t expect_num)
+{
+   COUNTER *tmp = gl_head_counters;
+   if (tmp == NULL) {
+   printf("\nNo message\n");
+   return false;
+   }
+   while (tmp != NULL) {
+   if (tmp->msg_count != expect_num) {
+   printf("\nGot %d message from %x\n",
+   tmp->msg_count, tmp->fr_dest);
+   return false;
+   }
+   tmp = tmp->next;
+   }
+   return true;
+}
+
+void tet_sender(MDS_SVC_ID svc_id, uint32_t msg_num, uint32_t msg_size,
+   int svc_num, MDS_SVC_ID to_svcids[],
+   uint32_t live_time)
 {
-   int live = 100; // sender live max 100s
TET_MDS_MSG *mesg;
if (msg_size > TET_MSG_SIZE_MIN) {
printf("\nSender: msg_size > TET_MSG_SIZE_MIN\n");
@@ -13117,72 +13172,83 @@ void tet_sender(uint32_t msg_count, uint32_t msg_size)
memset(mesg, 0, sizeof(TET_MDS_MSG));
 
printf("\nStarted Sender (pid:%d) svc_id=%d\n",
-   (int)getpid(), NCSMDS_SVC_ID_INTERNAL_MIN);
+   (int)getpid(), svc_id);
if (adest_get_handle() != NCSCC_RC_SUCCESS) {
printf("\n: Sender FAIL to get adest handle\n");
exit(1);
}
 
if (mds_service_install(gl_tet_adest.mds_pwe1_hdl,
-   NCSMDS_SVC_ID_INTERNAL_MIN, 1,
+   svc_id, 1,
NCSMDS_SCOPE_NONE, false, false) != 
NCSCC_RC_SUCCESS) {
printf("\nSender FAIL to install the service\n");
exit(1);
}
 
-   MDS_SVC_ID svcids[] = {NCSMDS_SVC_ID_EXTERNAL_MIN};
if (mds_service_subscribe(
-   gl_tet_adest.mds_pwe1_hdl, NCSMDS_SVC_ID_INTERNAL_MIN,
-   NCSMDS_SCOPE_INTRANODE, 1, svcids) != NCSCC_RC_SUCCESS) {
+   gl_tet_adest.mds_pwe1_hdl, svc_id,
+   NCSMDS_SCOPE_INTRANODE,
+   svc_num, to_svcids) != NCSCC_RC_SUCCESS) {
printf("\nSender FAIL to subscribe receiver\n");
exit(1);

[devel] [PATCH 1/1] osaf: perform handshake in tcp_server in new thread [#3099]

2019-10-10 Thread Gary Lee
---
 src/osaf/consensus/plugins/tcp/tcp_server.py | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/osaf/consensus/plugins/tcp/tcp_server.py 
b/src/osaf/consensus/plugins/tcp/tcp_server.py
index a7f22f2..c10859c 100755
--- a/src/osaf/consensus/plugins/tcp/tcp_server.py
+++ b/src/osaf/consensus/plugins/tcp/tcp_server.py
@@ -73,10 +73,15 @@ class ThreadedRPCServer(ThreadingMixIn,
 certfile=CERTFILE,
 keyfile=KEYFILE,
 cert_reqs=ssl.CERT_NONE,
-ssl_version=ssl.PROTOCOL_TLSv1_2)
+ssl_version=ssl.PROTOCOL_TLSv1_2,
+do_handshake_on_connect=False)
 self.server_bind()
 self.server_activate()
 
+def finish_request(self, request, client_address):
+ request.do_handshake()
+ return SimpleXMLRPCServer.finish_request(self, request, 
client_address)
+
 
 class Arbitrator(object):
 """ Implementation of a simple arbitrator """
-- 
2.7.4



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0/1] Review Request for osaf: perform handshake in tcp_server in new thread [#3099]

2019-10-10 Thread Gary Lee
Summary: osaf: perform handshake in tcp_server in new thread [#3099]
Review request for Ticket(s): 3099
Peer Reviewer(s): Hans, Minh, Thuan
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-3099
Base revision: e4c3c0c95644238fc84f31352e8ef289d9820ab4
Personal repository: git://git.code.sf.net/u/userid-2226215/review


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples y 
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-

revision fed332c489eb687982071013a8cb64e1932960e0
Author: Gary Lee 
Date:   Fri, 11 Oct 2019 14:08:50 +1100

osaf: perform handshake in tcp_server in new thread [#3099]



Complete diffstat:
--
 src/osaf/consensus/plugins/tcp/tcp_server.py | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)


Testing Commands:
-
1) Run tcp_server.py manually
2) telnet localhost  and don't enter anything
3) Run tcp.plugin and make sure it receives a response from the server

Testing, Expected Results:
--
As above. Without this patch, Step 3 will not work

Conditions of Submission:
-
Ack from anyone


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.gitconfig file (i.e. user.name, user.email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1/1] osaf: perform handshake in tcp_server in new thread [#3099]

2019-10-10 Thread Gary Lee

Hi

I should have put one more comment in.

Currently, the handshake is done in the equivalent of accept() running 
in the 'main thread'. If a client is malicious or faulty, then no one 
else can connect. But finish_request() is run from the thread created 
for each client.


Gary

On 11/10/19 2:22 pm, Gary Lee wrote:

---
  src/osaf/consensus/plugins/tcp/tcp_server.py | 7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/osaf/consensus/plugins/tcp/tcp_server.py 
b/src/osaf/consensus/plugins/tcp/tcp_server.py
index a7f22f2..c10859c 100755
--- a/src/osaf/consensus/plugins/tcp/tcp_server.py
+++ b/src/osaf/consensus/plugins/tcp/tcp_server.py
@@ -73,10 +73,15 @@ class ThreadedRPCServer(ThreadingMixIn,
  certfile=CERTFILE,
  keyfile=KEYFILE,
  cert_reqs=ssl.CERT_NONE,
-ssl_version=ssl.PROTOCOL_TLSv1_2)
+ssl_version=ssl.PROTOCOL_TLSv1_2,
+do_handshake_on_connect=False)
  self.server_bind()
  self.server_activate()
  
+def finish_request(self, request, client_address):

+ request.do_handshake()
+ return SimpleXMLRPCServer.finish_request(self, request, 
client_address)
+
  
  class Arbitrator(object):

  """ Implementation of a simple arbitrator """




smime.p7s
Description: S/MIME Cryptographic Signature
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1/1] mds: Add Reset message [#3090]

2019-10-10 Thread Minh Chau
mds relies on data message sent from the peer to determine
whether the MDS_TIPC_FCTRL_ENABLED is set. The data message
may not be sent right after TIPC_PUBLISHED event, which can
cause the tx probation timer timeout.

This patch add Reset message, which is sent right after the
TIPC_PUBLISHED to help mds determine the flow control supported
at the peer earlier.
---
 src/mds/mds_main.c   |  2 +-
 src/mds/mds_tipc_fctrl_intf.cc   | 27 ++
 src/mds/mds_tipc_fctrl_msg.cc| 11 +
 src/mds/mds_tipc_fctrl_msg.h | 18 +++
 src/mds/mds_tipc_fctrl_portid.cc | 49 ++--
 src/mds/mds_tipc_fctrl_portid.h  |  2 ++
 6 files changed, 96 insertions(+), 13 deletions(-)

diff --git a/src/mds/mds_main.c b/src/mds/mds_main.c
index 8c9b1f1..c7d2f7b 100644
--- a/src/mds/mds_main.c
+++ b/src/mds/mds_main.c
@@ -408,7 +408,7 @@ uint32_t mds_lib_req(NCS_LIB_REQ_INFO *req)
if (tipc_mcast_enabled != false)
tipc_mcast_enabled = true;
 
-   m_MDS_LOG_DBG(
+   m_MDS_LOG_NOTIFY(
"MDS: TIPC_MCAST_ENABLED: %d  Set argument 
\n",
tipc_mcast_enabled);
}
diff --git a/src/mds/mds_tipc_fctrl_intf.cc b/src/mds/mds_tipc_fctrl_intf.cc
index 6271890..e8c9121 100644
--- a/src/mds/mds_tipc_fctrl_intf.cc
+++ b/src/mds/mds_tipc_fctrl_intf.cc
@@ -39,6 +39,7 @@ using mds::DataMessage;
 using mds::ChunkAck;
 using mds::HeaderMessage;
 using mds::Nack;
+using mds::Reset;
 
 namespace {
 // flow control enabled/disabled
@@ -124,12 +125,20 @@ uint32_t process_flow_event(const Event& evt) {
   uint32_t rc = NCSCC_RC_SUCCESS;
   TipcPortId *portid = portid_lookup(evt.id_);
   if (portid == nullptr) {
+// the null portid normally should not happen; however because the
+// tipc_cb.Dsock and tipc_cb.BSRsock are separated; the data message
+// sent from BSRsock may come before reception of TIPC_PUBLISHED
 if (evt.type_ == Event::Type::kEvtRcvData) {
   portid = new TipcPortId(evt.id_, data_sock_fd,
   kChunkAckSize, sock_buf_size);
   portid_map[TipcPortId::GetUniqueId(evt.id_)] = portid;
   rc = portid->ReceiveData(evt.mseq_, evt.mfrag_,
 evt.fseq_, evt.svc_id_);
+} else if (evt.type_ == Event::Type::kEvtRcvReset) {
+  portid = new TipcPortId(evt.id_, data_sock_fd,
+  kChunkAckSize, sock_buf_size);
+  portid_map[TipcPortId::GetUniqueId(evt.id_)] = portid;
+  portid->ReceiveReset();
 } else {
   m_MDS_LOG_ERR("FCTRL: [me] <-- [node:%x, ref:%u], "
   "RcvEvt[evt:%d], Error[PortId not found]",
@@ -151,6 +160,9 @@ uint32_t process_flow_event(const Event& evt) {
   portid->ReceiveNack(evt.mseq_, evt.mfrag_,
   evt.fseq_);
 }
+if (evt.type_ == Event::Type::kEvtRcvReset) {
+  portid->ReceiveReset();
+}
   }
   return rc;
 }
@@ -489,6 +501,16 @@ uint32_t mds_tipc_fctrl_rcv_data(uint8_t *buffer, uint16_t 
len,
   m_MDS_LOG_ERR("FCTRL: Failed to send msg to mbx_events, Error[%s]",
   strerror(errno));
 }
+  } else if (header.msg_type_ == Reset::kResetMsgType) {
+// no need to decode reset message
+// the decoding reset message type is done in header decoding
+// send to the event thread
+if (m_NCS_IPC_SEND(&mbx_events,
+new Event(Event::Type::kEvtRcvReset, id, 0, 0, 0, 0),
+NCS_IPC_PRIORITY_HIGH) != NCSCC_RC_SUCCESS) {
+  m_MDS_LOG_ERR("FCTRL: Failed to send msg to mbx_events, Error[%s]",
+  strerror(errno));
+}
   } else {
 m_MDS_LOG_ERR("FCTRL: [me] <-- [node:%x, ref:%u], "
 "[msg_type:%u], Error[not supported message type]",
@@ -516,6 +538,11 @@ uint32_t mds_tipc_fctrl_rcv_data(uint8_t *buffer, uint16_t 
len,
   portid_map_mutex.unlock();
   return rc;
 }
+  } else {
+m_MDS_LOG_DBG("FCTRL: [me] <-- [node:%x, ref:%u], "
+"Receive non-flow-control data message, "
+"header.pro_ver:%u",
+id.node, id.ref, header.pro_ver_);
   }
   return NCSCC_RC_SUCCESS;
 }
diff --git a/src/mds/mds_tipc_fctrl_msg.cc b/src/mds/mds_tipc_fctrl_msg.cc
index 932120f..4aba3fb 100644
--- a/src/mds/mds_tipc_fctrl_msg.cc
+++ b/src/mds/mds_tipc_fctrl_msg.cc
@@ -178,4 +178,15 @@ void Nack::Decode(uint8_t *msg) {
   nacked_fseq_ = ncs_decode_16bit(&ptr);
 }
 
+
+void Reset::Encode(uint8_t *msg) {
+  uint8_t *ptr;
+  // encode protocol identifier
+  ptr = &msg[Reset::FieldIndex::kProtocolIdentifier];
+  ncs_encode_32bit(&ptr, MDS_PROT_FCTRL_ID);
+  // encode message type
+  ptr = &msg[Reset::FieldIndex::kFlowControlMessageType];
+  ncs_encode_8bit(&ptr, kResetMsgType);
+}
+
 }  // end namespace mds
diff --git a/src/mds/mds_tipc_fctrl_msg.h b/src/mds/mds_tipc_fctrl_msg.h
index e1db200..e94fb9d 100644
---

[devel] [PATCH 0/1] Review Request for mds: Add Reset message [#3090]

2019-10-10 Thread Minh Chau
Summary: mds: Add Reset message [#3090]
Review request for Ticket(s): 3090
Peer Reviewer(s): Hans, Gary, Vu, Thuan
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-3090
Base revision: e4c3c0c95644238fc84f31352e8ef289d9820ab4
Personal repository: git://git.code.sf.net/u/minh-chau/review


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision 4ef0125e47b71ea3da2fd653ecfdfc50e638b800
Author: Minh Chau 
Date:   Fri, 11 Oct 2019 14:42:04 +1100

mds: Add Reset message [#3090]

mds relies on data message sent from the peer to determine
whether the MDS_TIPC_FCTRL_ENABLED is set. The data message
may not be sent right after TIPC_PUBLISHED event, which can
cause the tx probation timer timeout.

This patch add Reset message, which is sent right after the
TIPC_PUBLISHED to help mds determine the flow control supported
at the peer earlier.



Complete diffstat:
--
 src/mds/mds_main.c   |  2 +-
 src/mds/mds_tipc_fctrl_intf.cc   | 27 ++
 src/mds/mds_tipc_fctrl_msg.cc| 11 +
 src/mds/mds_tipc_fctrl_msg.h | 18 +++
 src/mds/mds_tipc_fctrl_portid.cc | 49 ++--
 src/mds/mds_tipc_fctrl_portid.h  |  2 ++
 6 files changed, 96 insertions(+), 13 deletions(-)


Testing Commands:
-
*** LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES ***


Testing, Expected Results:
--
*** PASTE COMMAND OUTPUTS / TEST RESULTS ***


Conditions of Submission:
-
*** HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC ***


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.gitconfig file (i.e. user.name, user.email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel