Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
新注册的用户请输入邮箱并保存,随后登录邮箱激活账号。后续可直接使用邮箱登录!
Open sidebar
白 鹿
contract-sdk-go
Commits
65138938
Commit
65138938
authored
Oct 27, 2022
by
gh lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: revert pbpool
--bug=0
parent
bb55d5a0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
4 additions
and
53 deletions
+4
-53
Makefile
Makefile
+1
-8
pb/protogo/dockervm_message_vtproto.pb.go
pb/protogo/dockervm_message_vtproto.pb.go
+0
-36
sandbox/contract_engine_client.go
sandbox/contract_engine_client.go
+1
-2
sandbox/runtime_client.go
sandbox/runtime_client.go
+1
-3
sandbox/time_statics.go
sandbox/time_statics.go
+1
-3
sandbox/tx_handler.go
sandbox/tx_handler.go
+0
-1
No files found.
Makefile
View file @
65138938
gen
:
cd
pb/proto
&&
protoc
\
-
-gogofaster_out
=
plugins
=
grpc:../protogo
\
-
-gogofaster_opt
=
paths
=
source_relative
\
-
-go-vtproto_out
=
../protogo
--plugin
protoc-gen-go-vtproto
=
"
$(GOPATH)
/bin/protoc-gen-go-vtproto"
\
-
-go-vtproto_opt
=
paths
=
source_relative
\
-
-go-vtproto_opt
=
features
=
pool
\
-
-go-vtproto_opt
=
pool
=
chainmaker.org/chainmaker/contract-sdk-go/pb/protogo.DockerVMMessage
\
dockervm_message.proto
cd
pb/proto
&&
protoc
-I
=
.
--gogofaster_out
=
plugins
=
grpc:../protogo
--gogofaster_opt
=
paths
=
source_relative dockervm_message.proto
mockgen
:
mockgen
-destination
./sdk/mock_sdk_interface.go
-package
sdk
-source
./sdk/sdk_interface.go
...
...
pb/protogo/dockervm_message_vtproto.pb.go
deleted
100644 → 0
View file @
bb55d5a0
// Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
// protoc-gen-go-vtproto version: v0.3.0
// source: dockervm_message.proto
package
protogo
import
(
protoimpl
"google.golang.org/protobuf/runtime/protoimpl"
sync
"sync"
)
const
(
// Verify that this generated code is sufficiently up-to-date.
_
=
protoimpl
.
EnforceVersion
(
20
-
protoimpl
.
MinVersion
)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_
=
protoimpl
.
EnforceVersion
(
protoimpl
.
MaxVersion
-
20
)
)
var
vtprotoPool_DockerVMMessage
=
sync
.
Pool
{
New
:
func
()
interface
{}
{
return
&
DockerVMMessage
{}
},
}
func
(
m
*
DockerVMMessage
)
ResetVT
()
{
m
.
Reset
()
}
func
(
m
*
DockerVMMessage
)
ReturnToVTPool
()
{
if
m
!=
nil
{
m
.
ResetVT
()
vtprotoPool_DockerVMMessage
.
Put
(
m
)
}
}
func
DockerVMMessageFromVTPool
()
*
DockerVMMessage
{
return
vtprotoPool_DockerVMMessage
.
Get
()
.
(
*
DockerVMMessage
)
}
sandbox/contract_engine_client.go
View file @
65138938
...
...
@@ -106,8 +106,7 @@ func (c *ContractEngineClient) listenTxRequest() error {
// holds return values from gRPC Recv below
// recv message
for
{
msg
:=
protogo
.
DockerVMMessageFromVTPool
()
err
:=
c
.
rpcClient
.
RecvMsg
(
msg
)
msg
,
err
:=
c
.
rpcClient
.
Recv
()
switch
{
case
err
!=
nil
:
err
:=
fmt
.
Errorf
(
"client receive error from contract engine: %s"
,
err
)
...
...
sandbox/runtime_client.go
View file @
65138938
...
...
@@ -69,8 +69,7 @@ func (r *RuntimeClient) recvRoutine() error {
r
.
logger
.
Debugf
(
"close runtime client receive goroutine"
)
return
errors
.
New
(
"close runtime client receive goroutine"
)
default
:
receivedMsg
:=
protogo
.
DockerVMMessageFromVTPool
()
recvErr
:=
r
.
rpcClient
.
RecvMsg
(
receivedMsg
)
receivedMsg
,
recvErr
:=
r
.
rpcClient
.
Recv
()
if
recvErr
!=
nil
{
r
.
logger
.
Errorf
(
"client receive err from runtime %s"
,
recvErr
)
...
...
@@ -100,7 +99,6 @@ func (r *RuntimeClient) recvRoutine() error {
default
:
r
.
logger
.
Errorf
(
"unknown message type, received msg: [%v]"
,
receivedMsg
)
}
//receivedMsg.ReturnToVTPool()
}
}
}
...
...
sandbox/time_statics.go
View file @
65138938
...
...
@@ -153,9 +153,7 @@ func (t *TxDuration) addSysCallDuration(duration *SysCallDuration) {
// EnterNextStep enter next duration tx step
func
EnterNextStep
(
msg
*
protogo
.
DockerVMMessage
,
stepType
protogo
.
StepType
,
log
string
)
{
if
len
(
msg
.
StepDurations
)
==
0
{
return
}
if
stepType
!=
protogo
.
StepType_RUNTIME_PREPARE_TX_REQUEST
{
endTxStep
(
msg
)
}
...
...
sandbox/tx_handler.go
View file @
65138938
...
...
@@ -121,7 +121,6 @@ func (h *TxHandler) handleTxRequest(msg *protogo.DockerVMMessage) error {
defer
func
()
{
currentTxDuration
.
TotalDuration
=
time
.
Since
(
startTime
)
.
Nanoseconds
()
h
.
sandboxLogger
.
Debugf
(
currentTxDuration
.
ToString
())
msg
.
ReturnToVTPool
()
}()
args
:=
msg
.
GetRequest
()
.
GetParameters
()
...
...
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