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
7365f2fb
Commit
7365f2fb
authored
Nov 26, 2020
by
Peter Goodspeed-Niklaus
Browse files
REVERT ME: more logging tracing job lifespans
parent
78b5e9a0
Pipeline
#115177
canceled with stages
in 9 minutes and 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
node/subsystem-util/src/lib.rs
View file @
7365f2fb
...
...
@@ -418,6 +418,7 @@ struct JobHandle<ToJob> {
impl
<
ToJob
>
JobHandle
<
ToJob
>
{
/// Send a message to the job.
async
fn
send_msg
(
&
mut
self
,
msg
:
ToJob
)
->
Result
<
(),
Error
>
{
tracing
::
info!
(
"JobHandle::send_msg"
);
self
.to_job
.send
(
msg
)
.await
.map_err
(
Into
::
into
)
}
}
...
...
@@ -622,15 +623,24 @@ impl<Spawner: SpawnNamed, Job: 'static + JobTrait> Jobs<Spawner, Job> {
/// Stop the job associated with this `parent_hash`.
pub
async
fn
stop_job
(
&
mut
self
,
parent_hash
:
Hash
)
{
if
Job
::
NAME
==
"CandidateBackingJob"
{
tracing
::
info!
(
job
=
Job
::
NAME
,
relay_parent
=
?
parent_hash
,
"stop_job"
);
}
if
let
Some
(
handle
)
=
self
.running
.remove
(
&
parent_hash
)
{
handle
.stop
()
.await
;
}
else
{
if
Job
::
NAME
==
"CandidateBackingJob"
{
tracing
::
info!
(
job
=
Job
::
NAME
,
relay_parent
=
?
parent_hash
,
"stop_job but job was already gone"
);
}
}
}
/// Send a message to the appropriate job for this `parent_hash`.
async
fn
send_msg
(
&
mut
self
,
parent_hash
:
Hash
,
msg
:
Job
::
ToJob
)
{
if
let
Entry
::
Occupied
(
mut
job
)
=
self
.running
.entry
(
parent_hash
)
{
tracing
::
info!
(
job
=
Job
::
NAME
,
relay_parent
=
?
parent_hash
,
"send_msg sending message"
);
if
Job
::
NAME
==
"CandidateBackingJob"
{
tracing
::
info!
(
job
=
Job
::
NAME
,
relay_parent
=
?
parent_hash
,
"send_msg sending message"
);
}
if
job
.get_mut
()
.send_msg
(
msg
)
.await
.is_err
()
{
tracing
::
debug!
(
job
=
Job
::
NAME
,
"failed to send message to job, will remove it"
);
job
.remove
();
...
...
gabriel klawitter
🏄
@gabriel
mentioned in commit
4c5cd7a4
·
Nov 26, 2020
mentioned in commit
4c5cd7a4
mentioned in commit 4c5cd7a40649ccef3a3a0e0451c41237652bda2d
Toggle commit list
gabriel klawitter
🏄
@gabriel
mentioned in commit
113ae827
·
Dec 04, 2020
mentioned in commit
113ae827
mentioned in commit 113ae8272ecf2133272b9373123ffb4f74a00425
Toggle commit list
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