Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
fa8d8f96
Commit
fa8d8f96
authored
Jun 26, 2018
by
zhujiashun
Committed by
gejun
Sep 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only make main socket health check
parent
46ada252
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
http2_rpc_protocol.cpp
src/brpc/policy/http2_rpc_protocol.cpp
+4
-2
No files found.
src/brpc/policy/http2_rpc_protocol.cpp
View file @
fa8d8f96
...
...
@@ -1665,7 +1665,8 @@ void H2GlobalStreamCreator::ReplaceSocketForStream(
// since timeout of RPC is much larger than the delay of sending.
std
::
unique_lock
<
butil
::
Mutex
>
mu
(
_mutex
);
do
{
if
(
!
(
*
inout
)
->
_agent_socket
)
{
if
(
!
(
*
inout
)
->
_agent_socket
||
(
*
inout
)
->
_agent_socket
->
Failed
())
{
break
;
}
H2Context
*
ctx
=
static_cast
<
H2Context
*>
((
*
inout
)
->
_agent_socket
->
parsing_context
());
...
...
@@ -1683,7 +1684,7 @@ void H2GlobalStreamCreator::ReplaceSocketForStream(
SocketOptions
opt
=
(
*
inout
)
->
_options
;
// Only main socket can be the owner of ssl_ctx
opt
.
owns_ssl_ctx
=
false
;
opt
.
health_check_interval_s
=
FLAGS_health_check_interval
;
opt
.
health_check_interval_s
=
-
1
;
// TODO(zhujiashun): Predictively create socket to improve performance
if
(
get_client_side_messenger
()
->
Create
(
opt
,
&
sid
)
!=
0
)
{
cntl
->
SetFailed
(
EINVAL
,
"Fail to create H2 socket"
);
...
...
@@ -1694,6 +1695,7 @@ void H2GlobalStreamCreator::ReplaceSocketForStream(
cntl
->
SetFailed
(
EFAILEDSOCKET
,
"Fail to address H2 socketId=%"
PRIu64
,
sid
);
return
;
}
tmp_ptr
->
ShareStats
(
inout
->
get
());
(
*
inout
)
->
_agent_socket
.
swap
(
tmp_ptr
);
mu
.
unlock
();
(
*
inout
)
->
_agent_socket
->
ReAddress
(
inout
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment