[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-08-08 Thread Enis Soztutar (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16117915#comment-16117915
 ] 

Enis Soztutar commented on HBASE-18078:
---

[~xiaobingo] rpc-test.cc is failing with broken promise after this. Do you mind 
to take a look. Thanks. 

> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Fix For: HBASE-14850
>
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch, HBASE-18078.004.patch, 
> HBASE-18078.005.patch, HBASE-18078.006.patch, HBASE-18078.007.patch, 
> HBASE-18078.008.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-08-07 Thread Xiaobing Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16117573#comment-16117573
 ] 

Xiaobing Zhou commented on HBASE-18078:
---

Since the behavior of closing socket before sending request and after getting 
connection is beyond expectation (i.e.Broken promise for type 
unique_ptr), I've decided to move this case to separate ticket.

v8 is the work to be committed, v9 is dropped.

> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch, HBASE-18078.004.patch, 
> HBASE-18078.005.patch, HBASE-18078.006.patch, HBASE-18078.007.patch, 
> HBASE-18078.008.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-08-04 Thread Xiaobing Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16115168#comment-16115168
 ] 

Xiaobing Zhou commented on HBASE-18078:
---

Posted v9:
# added fault injection infra, see also RpcFaultInjector and 
RpcClientFaultInjector
# inject fault to close pipeline in ClientDispatcher::operator() to simulate 
the scenario to get AsyncSocketException after creating connection and before 
sending request
# added unit test

AsyncSocketException is expected, however, Broken promise for type 
unique_ptr is returned, will debug into this.

> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch, HBASE-18078.004.patch, 
> HBASE-18078.005.patch, HBASE-18078.006.patch, HBASE-18078.007.patch, 
> HBASE-18078.008.patch, HBASE-18078.009.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-08-04 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16115078#comment-16115078
 ] 

Hadoop QA commented on HBASE-18078:
---

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue}  0m  
0s{color} | {color:blue} Docker mode activated. {color} |
| {color:red}-1{color} | {color:red} patch {color} | {color:red}  1m 41s{color} 
| {color:red} HBASE-18078 does not apply to master. Rebase required? Wrong 
Branch? See https://yetus.apache.org/documentation/0.4.0/precommit-patchnames 
for help. {color} |
\\
\\
|| Subsystem || Report/Notes ||
| JIRA Issue | HBASE-18078 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/12880452/HBASE-18078.008.patch 
|
| Console output | 
https://builds.apache.org/job/PreCommit-HBASE-Build/7933/console |
| Powered by | Apache Yetus 0.4.0   http://yetus.apache.org |


This message was automatically generated.



> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch, HBASE-18078.004.patch, 
> HBASE-18078.005.patch, HBASE-18078.006.patch, HBASE-18078.007.patch, 
> HBASE-18078.008.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-08-04 Thread Xiaobing Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16114894#comment-16114894
 ] 

Xiaobing Zhou commented on HBASE-18078:
---

Thanks for review. v8 is posted.

# removed ConnectionRetryPolicy comment
# used VLOG(3) for RpcClient Exception

In addition:
# added socketNotOpen function in test_rpc_service.proto
# added unit tests for socketNotOpen

In RpcClient::SendRequest, we need to handle two cases for ConnectionException:
 # The first time connection establishment, i.e. GetConnection(remote_id), 
AsyncSocketException being a cause.
# Writing request down the pipeline, i.e. RpcConnection::SendRequest, 
AsyncSocketException being a cause as well.

The socketNotOpen covers the case of GetConnection(remote_id). Another test is 
needed to cover RpcConnection::SendRequest.

> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch, HBASE-18078.004.patch, 
> HBASE-18078.005.patch, HBASE-18078.006.patch, HBASE-18078.007.patch, 
> HBASE-18078.008.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-08-04 Thread Enis Soztutar (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16114783#comment-16114783
 ] 

Enis Soztutar commented on HBASE-18078:
---

Thanks [~xiaobingo] for the updated patch. 
As we were talking offline, we are not gonna do ConnectionRetryPolicy. Upper 
level retrying from Rpc Retrying Callers will work just fine for 
re-establishing the connection. 
{code}
+ * TODO:
+ * This function should plug in ConnectionRetryPolicy to handle:
+
{code}
- We can do this as VLOG(1): 
{code}
+  VLOG(3) << folly::sformat("RpcClient Exception: {}", ew.what());
{code}
- Do we need to catch the AsyncSocketException at this level as well: 
{code}
+return GetConnection(remote_id)
+->SendRequest(std::move(req))
+.onError([&, this](const folly::exception_wrapper& ew) {
{code}
or below layers already handle it in every case and rethrow it as 
ConnectionException. 

Other than these, patch looks good. We need the unit tests for committing it. 


> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch, HBASE-18078.004.patch, 
> HBASE-18078.005.patch, HBASE-18078.006.patch, HBASE-18078.007.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-08-04 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16114350#comment-16114350
 ] 

Hadoop QA commented on HBASE-18078:
---

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue}  0m  
0s{color} | {color:blue} Docker mode activated. {color} |
| {color:red}-1{color} | {color:red} patch {color} | {color:red}  0m  5s{color} 
| {color:red} HBASE-18078 does not apply to master. Rebase required? Wrong 
Branch? See https://yetus.apache.org/documentation/0.4.0/precommit-patchnames 
for help. {color} |
\\
\\
|| Subsystem || Report/Notes ||
| JIRA Issue | HBASE-18078 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/12880339/HBASE-18078.007.patch 
|
| Console output | 
https://builds.apache.org/job/PreCommit-HBASE-Build/7917/console |
| Powered by | Apache Yetus 0.4.0   http://yetus.apache.org |


This message was automatically generated.



> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch, HBASE-18078.004.patch, 
> HBASE-18078.005.patch, HBASE-18078.006.patch, HBASE-18078.007.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-08-03 Thread Xiaobing Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16113903#comment-16113903
 ] 

Xiaobing Zhou commented on HBASE-18078:
---

v7:
# added RpcClient::GetFutureWithException 
#  fixe broken tests due to v6

Extra tests come with next patch.

> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch, HBASE-18078.004.patch, 
> HBASE-18078.005.patch, HBASE-18078.006.patch, HBASE-18078.007.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-08-02 Thread Xiaobing Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16111808#comment-16111808
 ] 

Xiaobing Zhou commented on HBASE-18078:
---

Posted v6:
# Catch AsyncSocketException in ConnectionFactory::Connect, and throw it as 
ConnectionException, which will be propagated up to 
ConnectionPool::GetConnection and RpcClient::SendRequest, finally caller of 
RpcClient will get ConnectionException.
# While writing data down the pipeline, RpcConnection::SendRequest will also 
encounter AsyncSocketException, similarly, it's propagated to caller of 
RpcClient.

The patch considered two cases:
# AsyncSocketException as a result of the 1st time connection establishment.
# ConnectionException (i.e. AsyncSocketException as a cause) for 
Request/Response async call after the corresponding connection is established.


> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch, HBASE-18078.004.patch, 
> HBASE-18078.005.patch, HBASE-18078.006.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-07-26 Thread Xiaobing Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16102511#comment-16102511
 ] 

Xiaobing Zhou commented on HBASE-18078:
---

Posted v5:
# added two functions (i.e. ping and addr) implementation in 
test_rpc_service.proto
# rebased HBASE-18338
# did some refactoring

v6 will come with error implementation that triggers ConnectionException.

> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch, HBASE-18078.004.patch, 
> HBASE-18078.005.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-07-20 Thread Xiaobing Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16095583#comment-16095583
 ] 

Xiaobing Zhou commented on HBASE-18078:
---

Posted v4:
# removed RPC test related pieces.
# did some clean work.

> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch, HBASE-18078.004.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-07-07 Thread Xiaobing Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16078760#comment-16078760
 ] 

Xiaobing Zhou commented on HBASE-18078:
---

This ticket will not contain anything related to TestRpcServer, it will be in 
HBASE-18338.

> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-07-06 Thread Xiaobing Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16077259#comment-16077259
 ] 

Xiaobing Zhou commented on HBASE-18078:
---

Posted v3.
# fixed rebase conflicts
# add RPC test server skeleton
# 
[~enis] you are right, we are not going change behaviors of connection 
establishment. The initial attempt of AsyncConnect is to satisfy connection 
pool or pass the existing unit tests. I will get back by removing the async 
later on. Thanks.


> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch, HBASE-18078.003.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-05-30 Thread Enis Soztutar (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16030188#comment-16030188
 ] 

Enis Soztutar commented on HBASE-18078:
---

- You are still calling Future::get() here in the 
{{ConnectionFactory::AsyncConnect}}, no? 
{code}
+auto pipeline = client->connect(
+SocketAddress(hostname, port, true),
+std::chrono::duration_cast(connect_timeout_)).get();
{code}
- If this patch is not changing the blocking nature of our TCP connection 
establishment, maybe we should not introduce these methods, especially 
{{ConnectionPool::AsyncGetNewConnection}} which seems to be a copy of the other 
method. 

> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch, HBASE-18078.001.patch, 
> HBASE-18078.002.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-05-25 Thread Xiaobing Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16025824#comment-16025824
 ] 

Xiaobing Zhou commented on HBASE-18078:
---

Coming next are:

# apply the APIs (e.g. ConnectionFactory and ConnectionPool) changes to all 
related places.
# In order to simulate various abnormal behaviors, it necessitates building a 
TestRpcServer, which can be started from samples in 
[BootstrapTest|https://github.com/facebook/wangle/blob/master/wangle/bootstrap/BootstrapTest.cpp]
# handle other abnormal cases such as defined in folly::AsyncSocketException
{code}
class AsyncSocketException : public std::runtime_error {
 public:
  enum AsyncSocketExceptionType {
UNKNOWN = 0,
NOT_OPEN = 1,
ALREADY_OPEN = 2,
TIMED_OUT = 3,
END_OF_FILE = 4,
INTERRUPTED = 5,
BAD_ARGS = 6,
CORRUPTED_DATA = 7,
INTERNAL_ERROR = 8,
NOT_SUPPORTED = 9,
INVALID_STATE = 10,
SSL_ERROR = 12,
COULD_NOT_BIND = 13,
SASL_HANDSHAKE_TIMEOUT = 14,
NETWORK_ERROR = 15
  };
{code}
#  add unit tests to cover them.

> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (HBASE-18078) [C++] Harden RPC by handling various communication abnormalities

2017-05-25 Thread Xiaobing Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16025812#comment-16025812
 ] 

Xiaobing Zhou commented on HBASE-18078:
---

Posted v0 patch to handle connection related issues, such as timeout.

The idea is to catch and propagate ConnectionException up. Therefore, from 
bottom of stack, whatever issues from establishing connection (i.e. Wangle 
pipeline) will be folly::AsyncSocketException wrapped within 
ConnectionException.

Note that there's no way to set socket options in Wangle ClientBootstrap, but 
fortunately, ClientBootstrap::connect supports setting our own timeout which is 
enough for now.

See also ConnectionFactory::Connect
{code}
try {
  /* any connection error (e.g. timeout) will be 
folly::AsyncSocketException */
auto pipeline = client->connect(
SocketAddress(hostname, port, true),
std::chrono::duration_cast(connect_timeout_)).get();
auto dispatcher = std::make_shared();
dispatcher->setPipeline(pipeline);
promise.setValue(dispatcher);
} catch(const folly::AsyncSocketException ) {
  promise.setException(
  folly::make_exception_wrapper(
  
folly::make_exception_wrapper(e)));
}
{code}


> [C++] Harden RPC by handling various communication abnormalities
> 
>
> Key: HBASE-18078
> URL: https://issues.apache.org/jira/browse/HBASE-18078
> Project: HBase
>  Issue Type: Sub-task
>Reporter: Xiaobing Zhou
>Assignee: Xiaobing Zhou
> Attachments: HBASE-18078.000.patch
>
>
> RPC layer should handle various communication abnormalities (e.g. connection 
> timeout, server aborted connection, and so on). Ideally, the corresponding 
> exceptions should be raised and propagated through handlers of pipeline in 
> client.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)