Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
d7480106
Commit
d7480106
authored
1 year ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
fix: cleanup supervisor logs
parent
1ada9710
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!636
Fix retry io error
Pipeline
#21996
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.rs
+36
-5
36 additions, 5 deletions
src/main.rs
with
36 additions
and
5 deletions
src/main.rs
+
36
−
5
View file @
d7480106
...
...
@@ -107,7 +107,7 @@ fn main_run(args: args::Run) -> ! {
let
parent
=
unistd
::
getpid
();
let
mut
entrypoint
=
Entrypoint
::
StartDiscover
{};
loop
{
println!
(
"[supervisor:{parent}] running {entrypoint:?}"
);
e
println!
(
"[supervisor:{parent}] running {entrypoint:?}"
);
let
(
from_child
,
to_parent
)
=
ipc
::
channel
::
<
IpcMessage
>
()
.expect
(
"ipc channel creation failed"
);
...
...
@@ -164,13 +164,44 @@ fn main_run(args: args::Run) -> ! {
}
if
let
Some
(
sig
)
=
unsafe
{
SIGNALLED
}
{
println!
(
"[supervisor:{parent}] got signal {sig}"
);
e
println!
(
"[supervisor:{parent}] got signal {sig}"
);
}
println!
(
"[supervisor:{parent}] ipc message from child: {msg:?}"
);
match
&
msg
{
Ok
(
msg
)
=>
{
eprintln!
(
"[supervisor:{parent}] ipc message from child: {msg:?}"
);
}
Err
(
rmp_serde
::
decode
::
Error
::
InvalidMarkerRead
(
e
))
if
e
.kind
()
==
std
::
io
::
ErrorKind
::
UnexpectedEof
=>
{
eprintln!
(
"[supervisor:{parent}] no ipc message from child"
);
}
Err
(
e
)
=>
{
eprintln!
(
"[supervisor:{parent}] failed reading ipc message from child: {e}"
);
}
}
let
status
=
status
.unwrap
();
println!
(
"[supervisor:{parent}] subprocess finished: {status:?}"
);
match
status
{
nix
::
sys
::
wait
::
WaitStatus
::
Exited
(
pid
,
rc
)
=>
{
eprintln!
(
"[supervisor:{parent}] subprocess {pid} exited with code {rc}"
);
}
nix
::
sys
::
wait
::
WaitStatus
::
Signaled
(
pid
,
signal
,
core_dumped
)
=>
{
eprintln!
(
"[supervisor:{parent}] subprocess {pid} was signaled with {signal}"
);
if
core_dumped
{
eprintln!
(
"[supervisor:{parent}] core dumped"
);
}
}
status
=>
{
eprintln!
(
"[supervisor:{parent}] subprocess finished with status: {status:?}"
);
}
}
if
let
Ok
(
msg
)
=
msg
{
entrypoint
=
msg
.next_entrypoint
;
...
...
@@ -202,7 +233,7 @@ fn rm_tarantool_files(data_dir: &str) {
.unwrap_or
(
false
)
})
.for_each
(|
f
|
{
println!
(
"[supervisor] removing file: {}"
,
f
.to_string_lossy
());
e
println!
(
"[supervisor] removing file: {}"
,
f
.to_string_lossy
());
std
::
fs
::
remove_file
(
f
)
.unwrap
();
});
}
...
...
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