good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
66228507
Commit
66228507
authored
Jun 25, 2015
by
Bas van Kervel
Browse files
Options
Downloads
Patches
Plain Diff
improved logging for IPC connection lifetime management
parent
5757a0ed
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
rpc/comms/comms.go
+4
-4
4 additions, 4 deletions
rpc/comms/comms.go
rpc/comms/ipc.go
+5
-0
5 additions, 0 deletions
rpc/comms/ipc.go
rpc/comms/ipc_unix.go
+4
-1
4 additions, 1 deletion
rpc/comms/ipc_unix.go
rpc/comms/ipc_windows.go
+10
-7
10 additions, 7 deletions
rpc/comms/ipc_windows.go
with
23 additions
and
12 deletions
rpc/comms/comms.go
+
4
−
4
View file @
66228507
...
@@ -43,7 +43,7 @@ type EthereumClient interface {
...
@@ -43,7 +43,7 @@ type EthereumClient interface {
SupportedModules
()
(
map
[
string
]
string
,
error
)
SupportedModules
()
(
map
[
string
]
string
,
error
)
}
}
func
handle
(
conn
net
.
Conn
,
api
shared
.
EthereumApi
,
c
codec
.
Codec
)
{
func
handle
(
id
int
,
conn
net
.
Conn
,
api
shared
.
EthereumApi
,
c
codec
.
Codec
)
{
codec
:=
c
.
New
(
conn
)
codec
:=
c
.
New
(
conn
)
for
{
for
{
...
@@ -52,8 +52,8 @@ func handle(conn net.Conn, api shared.EthereumApi, c codec.Codec) {
...
@@ -52,8 +52,8 @@ func handle(conn net.Conn, api shared.EthereumApi, c codec.Codec) {
codec
.
Close
()
codec
.
Close
()
return
return
}
else
if
err
!=
nil
{
}
else
if
err
!=
nil
{
glog
.
V
(
logger
.
Error
)
.
Infof
(
"comms recv err - %v
\n
"
,
err
)
codec
.
Close
()
codec
.
Close
()
glog
.
V
(
logger
.
Debug
)
.
Infof
(
"Closed IPC Conn %06d recv err - %v
\n
"
,
id
,
err
)
return
return
}
}
...
@@ -71,8 +71,8 @@ func handle(conn net.Conn, api shared.EthereumApi, c codec.Codec) {
...
@@ -71,8 +71,8 @@ func handle(conn net.Conn, api shared.EthereumApi, c codec.Codec) {
err
=
codec
.
WriteResponse
(
responses
[
:
responseCount
])
err
=
codec
.
WriteResponse
(
responses
[
:
responseCount
])
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
V
(
logger
.
Error
)
.
Infof
(
"comms send err - %v
\n
"
,
err
)
codec
.
Close
()
codec
.
Close
()
glog
.
V
(
logger
.
Debug
)
.
Infof
(
"Closed IPC Conn %06d send err - %v
\n
"
,
id
,
err
)
return
return
}
}
}
else
{
}
else
{
...
@@ -82,8 +82,8 @@ func handle(conn net.Conn, api shared.EthereumApi, c codec.Codec) {
...
@@ -82,8 +82,8 @@ func handle(conn net.Conn, api shared.EthereumApi, c codec.Codec) {
rpcResponse
=
shared
.
NewRpcResponse
(
requests
[
0
]
.
Id
,
requests
[
0
]
.
Jsonrpc
,
res
,
err
)
rpcResponse
=
shared
.
NewRpcResponse
(
requests
[
0
]
.
Id
,
requests
[
0
]
.
Jsonrpc
,
res
,
err
)
err
=
codec
.
WriteResponse
(
rpcResponse
)
err
=
codec
.
WriteResponse
(
rpcResponse
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
V
(
logger
.
Error
)
.
Infof
(
"comms send err - %v
\n
"
,
err
)
codec
.
Close
()
codec
.
Close
()
glog
.
V
(
logger
.
Debug
)
.
Infof
(
"Closed IPC Conn %06d send err - %v
\n
"
,
id
,
err
)
return
return
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
rpc/comms/ipc.go
+
5
−
0
View file @
66228507
...
@@ -2,6 +2,7 @@ package comms
...
@@ -2,6 +2,7 @@ package comms
import
(
import
(
"fmt"
"fmt"
"math/rand"
"net"
"net"
"encoding/json"
"encoding/json"
...
@@ -95,3 +96,7 @@ func NewIpcClient(cfg IpcConfig, codec codec.Codec) (*ipcClient, error) {
...
@@ -95,3 +96,7 @@ func NewIpcClient(cfg IpcConfig, codec codec.Codec) (*ipcClient, error) {
func
StartIpc
(
cfg
IpcConfig
,
codec
codec
.
Codec
,
offeredApi
shared
.
EthereumApi
)
error
{
func
StartIpc
(
cfg
IpcConfig
,
codec
codec
.
Codec
,
offeredApi
shared
.
EthereumApi
)
error
{
return
startIpc
(
cfg
,
codec
,
offeredApi
)
return
startIpc
(
cfg
,
codec
,
offeredApi
)
}
}
func
newIpcConnId
()
int
{
return
rand
.
Int
()
%
1000000
}
This diff is collapsed.
Click to expand it.
rpc/comms/ipc_unix.go
+
4
−
1
View file @
66228507
...
@@ -48,7 +48,10 @@ func startIpc(cfg IpcConfig, codec codec.Codec, api shared.EthereumApi) error {
...
@@ -48,7 +48,10 @@ func startIpc(cfg IpcConfig, codec codec.Codec, api shared.EthereumApi) error {
continue
continue
}
}
go
handle
(
conn
,
api
,
codec
)
id
:=
newIpcConnId
()
glog
.
V
(
logger
.
Debug
)
.
Infof
(
"New IPC connection with id %06d started
\n
"
,
id
)
go
handle
(
id
,
conn
,
api
,
codec
)
}
}
os
.
Remove
(
cfg
.
Endpoint
)
os
.
Remove
(
cfg
.
Endpoint
)
...
...
This diff is collapsed.
Click to expand it.
rpc/comms/ipc_windows.go
+
10
−
7
View file @
66228507
...
@@ -668,7 +668,10 @@ func startIpc(cfg IpcConfig, codec codec.Codec, api shared.EthereumApi) error {
...
@@ -668,7 +668,10 @@ func startIpc(cfg IpcConfig, codec codec.Codec, api shared.EthereumApi) error {
continue
continue
}
}
go
handle
(
conn
,
api
,
codec
)
id
:=
newIpcConnId
()
glog
.
V
(
logger
.
Debug
)
.
Infof
(
"New IPC connection with id %06d started
\n
"
,
id
)
go
handle
(
id
,
conn
,
api
,
codec
)
}
}
os
.
Remove
(
cfg
.
Endpoint
)
os
.
Remove
(
cfg
.
Endpoint
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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