Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
a884a38d
Commit
a884a38d
authored
4 years ago
by
LaurenceLiZhixin
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'upstream/develop' into develop
parents
c698ef25
5c760406
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
protocol/protocolwrapper/protocol_filter_wrapper.go
+5
-1
5 additions, 1 deletion
protocol/protocolwrapper/protocol_filter_wrapper.go
remoting/getty/getty_client.go
+13
-3
13 additions, 3 deletions
remoting/getty/getty_client.go
with
18 additions
and
4 deletions
protocol/protocolwrapper/protocol_filter_wrapper.go
+
5
−
1
View file @
a884a38d
...
...
@@ -59,7 +59,11 @@ func (pfw *ProtocolFilterWrapper) Refer(url *common.URL) protocol.Invoker {
if
pfw
.
protocol
==
nil
{
pfw
.
protocol
=
extension
.
GetProtocol
(
url
.
Protocol
)
}
return
buildInvokerChain
(
pfw
.
protocol
.
Refer
(
url
),
constant
.
REFERENCE_FILTER_KEY
)
invoker
:=
pfw
.
protocol
.
Refer
(
url
)
if
invoker
==
nil
{
return
nil
}
return
buildInvokerChain
(
invoker
,
constant
.
REFERENCE_FILTER_KEY
)
}
// Destroy will destroy all invoker and exporter.
...
...
This diff is collapsed.
Click to expand it.
remoting/getty/getty_client.go
+
13
−
3
View file @
a884a38d
...
...
@@ -19,6 +19,7 @@ package getty
import
(
"math/rand"
"sync"
"time"
)
...
...
@@ -116,6 +117,7 @@ type Client struct {
addr
string
opts
Options
conf
ClientConfig
mux
sync
.
RWMutex
pool
*
gettyRPCClientPool
codec
remoting
.
Codec
ExchangeClient
*
remoting
.
ExchangeClient
...
...
@@ -161,10 +163,13 @@ func (c *Client) Connect(url *common.URL) error {
// close network connection
func
(
c
*
Client
)
Close
()
{
if
c
.
pool
!=
nil
{
c
.
pool
.
close
()
}
c
.
mux
.
Lock
()
p
:=
c
.
pool
c
.
pool
=
nil
c
.
mux
.
Unlock
()
if
p
!=
nil
{
p
.
close
()
}
}
// send request
...
...
@@ -204,6 +209,11 @@ func (c *Client) IsAvailable() bool {
}
func
(
c
*
Client
)
selectSession
(
addr
string
)
(
*
gettyRPCClient
,
getty
.
Session
,
error
)
{
c
.
mux
.
RLock
()
defer
c
.
mux
.
RUnlock
()
if
c
.
pool
==
nil
{
return
nil
,
nil
,
perrors
.
New
(
"client pool have been closed"
)
}
rpcClient
,
err
:=
c
.
pool
.
getGettyRpcClient
(
addr
)
if
err
!=
nil
{
return
nil
,
nil
,
perrors
.
WithStack
(
err
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment