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
c6c0535c
Commit
c6c0535c
authored
4 years ago
by
AlexStocks
Browse files
Options
Downloads
Patches
Plain Diff
Fix: ut fail
parent
095d3f5e
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/dubbo/dubbo_invoker_test.go
+3
-4
3 additions, 4 deletions
protocol/dubbo/dubbo_invoker_test.go
remoting/getty/pool.go
+11
-4
11 additions, 4 deletions
remoting/getty/pool.go
with
14 additions
and
8 deletions
protocol/dubbo/dubbo_invoker_test.go
+
3
−
4
View file @
c6c0535c
...
...
@@ -89,15 +89,15 @@ func TestDubboInvokerInvoke(t *testing.T) {
// destroy
lock
.
Lock
()
defer
lock
.
Unlock
()
proto
.
Destroy
()
lock
.
Unlock
()
}
func
InitTest
(
t
*
testing
.
T
)
(
protocol
.
Protocol
,
common
.
URL
)
{
hessian
.
RegisterPOJO
(
&
User
{})
methods
,
err
:=
common
.
ServiceMap
.
Register
(
""
,
"dubbo"
,
&
UserProvider
{})
methods
,
err
:=
common
.
ServiceMap
.
Register
(
"
com.ikurento.user.UserProvider
"
,
"dubbo"
,
&
UserProvider
{})
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
"GetBigPkg,GetUser,GetUser0,GetUser1,GetUser2,GetUser3,GetUser4,GetUser5,GetUser6"
,
methods
)
...
...
@@ -176,10 +176,9 @@ type (
// size:4801228
func
(
u
*
UserProvider
)
GetBigPkg
(
ctx
context
.
Context
,
req
[]
interface
{},
rsp
*
User
)
error
{
argBuf
:=
new
(
bytes
.
Buffer
)
for
i
:=
0
;
i
<
4
00
;
i
++
{
for
i
:=
0
;
i
<
8
00
;
i
++
{
// use chinese for test
argBuf
.
WriteString
(
"击鼓其镗,踊跃用兵。土国城漕,我独南行。从孙子仲,平陈与宋。不我以归,忧心有忡。爰居爰处?爰丧其马?于以求之?于林之下。死生契阔,与子成说。执子之手,与子偕老。于嗟阔兮,不我活兮。于嗟洵兮,不我信兮。"
)
argBuf
.
WriteString
(
"击鼓其镗,踊跃用兵。土国城漕,我独南行。从孙子仲,平陈与宋。不我以归,忧心有忡。爰居爰处?爰丧其马?于以求之?于林之下。死生契阔,与子成说。执子之手,与子偕老。于嗟阔兮,不我活兮。于嗟洵兮,不我信兮。"
)
}
rsp
.
Id
=
argBuf
.
String
()
rsp
.
Name
=
argBuf
.
String
()
...
...
This diff is collapsed.
Click to expand it.
remoting/getty/pool.go
+
11
−
4
View file @
c6c0535c
...
...
@@ -81,19 +81,26 @@ func newGettyRPCClientConn(pool *gettyRPCClientPool, addr string) (*gettyRPCClie
gettyClient
:
gettyClient
,
}
go
c
.
gettyClient
.
RunEventLoop
(
c
.
newSession
)
idx
:=
1
times
:=
int
(
pool
.
rpcClient
.
opts
.
ConnectTimeout
/
1e6
)
start
:=
time
.
Now
()
connectTimeout
:=
pool
.
rpcClient
.
opts
.
ConnectTimeout
for
{
idx
++
if
c
.
isAvailable
()
{
break
}
if
idx
>
times
{
if
time
.
Now
()
.
Sub
(
start
)
>
connectTimeout
{
c
.
gettyClient
.
Close
()
return
nil
,
perrors
.
New
(
fmt
.
Sprintf
(
"failed to create client connection to %s in %f seconds"
,
addr
,
float32
(
times
)
/
1000
))
return
nil
,
perrors
.
New
(
fmt
.
Sprintf
(
"failed to create client connection to %s in %s"
,
addr
,
connectTimeout
))
}
interval
:=
time
.
Millisecond
*
time
.
Duration
(
idx
)
if
interval
>
time
.
Duration
(
100e6
)
{
interval
=
100e6
// 100 ms
}
time
.
Sleep
(
time
.
Millisecond
*
time
.
Duration
(
times
)
)
time
.
Sleep
(
interval
)
}
logger
.
Debug
(
"client init ok"
)
c
.
updateActive
(
time
.
Now
()
.
Unix
())
...
...
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