Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
7229ab87
Unverified
Commit
7229ab87
authored
Sep 10, 2021
by
Sergey Pepyakin
Committed by
GitHub
Sep 10, 2021
Browse files
Add logging for worker spawn failures (#3827)
parent
a1399fba
Pipeline
#156695
passed with stages
in 39 minutes and 54 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
node/core/pvf/src/worker_common.rs
View file @
7229ab87
...
...
@@ -47,14 +47,38 @@ pub async fn spawn_with_program_path(
with_transient_socket_path
(
debug_id
,
|
socket_path
|
{
let
socket_path
=
socket_path
.to_owned
();
async
move
{
let
listener
=
UnixListener
::
bind
(
&
socket_path
)
.await
.map_err
(|
_
|
SpawnErr
::
Bind
)
?
;
let
handle
=
WorkerHandle
::
spawn
(
program_path
,
extra_args
,
socket_path
)
.map_err
(|
_
|
SpawnErr
::
ProcessSpawn
)
?
;
let
listener
=
UnixListener
::
bind
(
&
socket_path
)
.await
.map_err
(|
err
|
{
tracing
::
warn!
(
target
:
LOG_TARGET
,
%
debug_id
,
"cannot bind unix socket: {:?}"
,
err
,
);
SpawnErr
::
Bind
})
?
;
let
handle
=
WorkerHandle
::
spawn
(
program_path
,
extra_args
,
socket_path
)
.map_err
(|
err
|
{
tracing
::
warn!
(
target
:
LOG_TARGET
,
%
debug_id
,
"cannot spawn a worker: {:?}"
,
err
,
);
SpawnErr
::
ProcessSpawn
})
?
;
futures
::
select!
{
accept_result
=
listener
.accept
()
.fuse
()
=>
{
let
(
stream
,
_
)
=
accept_result
.map_err
(|
_
|
SpawnErr
::
Accept
)
?
;
let
(
stream
,
_
)
=
accept_result
.map_err
(|
err
|
{
tracing
::
warn!
(
target
:
LOG_TARGET
,
%
debug_id
,
"cannot accept a worker: {:?}"
,
err
,
);
SpawnErr
::
Accept
})
?
;
Ok
((
IdleWorker
{
stream
,
pid
:
handle
.id
()
},
handle
))
}
_
=
Delay
::
new
(
spawn_timeout
)
.fuse
()
=>
{
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment