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
ecc4e2c4
Commit
ecc4e2c4
authored
7 months ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
fix: disable logging from non-main threads because of performance problems
parent
9d52b582
No related branches found
No related tags found
1 merge request
!1301
fix: disable logging from non-main threads because of performance problems
Pipeline
#51096
failed
7 months ago
Stage: test
Stage: docker
Stage: stress-test
Stage: front-deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lib.rs
+4
-0
4 additions, 0 deletions
src/lib.rs
src/tlog.rs
+4
-2
4 additions, 2 deletions
src/tlog.rs
with
8 additions
and
2 deletions
src/lib.rs
+
4
−
0
View file @
ecc4e2c4
...
...
@@ -639,6 +639,10 @@ fn init_common(
}
cbus
::
init_cbus_endpoint
();
// There's a problem with cbus channels at the moment, they introduce too
// much performance penalty when polling them if they're empty,
// so we only enable the thread-safe logger in debug builds for now
#[cfg(debug_assertions)]
tlog
::
init_thread_safe_logger
();
if
config
.instance
.shredding
()
{
...
...
This diff is collapsed.
Click to expand it.
src/tlog.rs
+
4
−
2
View file @
ecc4e2c4
...
...
@@ -189,8 +189,10 @@ pub fn log_from_non_tx_thread(level: slog::Level, message: String) {
return
;
};
// TODO: check log level and exit early
let
sender
=
sender
.as_ref
()
.expect
(
"is set at picodata startup"
);
let
Some
(
sender
)
=
sender
.as_ref
()
else
{
// Thread-safe logger is disabled
return
;
};
let
res
=
sender
.send
(
ThreadSafeLogRequest
{
thread_name
:
std
::
thread
::
current
()
.name
()
.unwrap_or
(
"<unknown>"
)
.into
(),
...
...
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