Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
🥺
conduwuit
Commits
79bf7fc5
Commit
79bf7fc5
authored
3 years ago
by
Jonathan de Jong
Browse files
Options
Downloads
Patches
Plain Diff
some logging shuffling
parent
7e579f8d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/database/abstraction/sqlite.rs
+6
-3
6 additions, 3 deletions
src/database/abstraction/sqlite.rs
with
6 additions
and
3 deletions
src/database/abstraction/sqlite.rs
+
6
−
3
View file @
79bf7fc5
...
@@ -150,11 +150,16 @@ fn read_lock(&self) -> HoldingConn<'_> {
...
@@ -150,11 +150,16 @@ fn read_lock(&self) -> HoldingConn<'_> {
}
}
}
}
log
::
debug!
(
"read_lock: All permanent readers locked, obtaining spillover reader..."
);
// We didn't get a connection from the permanent pool, so we'll dumpster-dive for recycled connections.
// We didn't get a connection from the permanent pool, so we'll dumpster-dive for recycled connections.
// Either we have a connection or we dont, if we don't, we make a new one.
// Either we have a connection or we dont, if we don't, we make a new one.
let
conn
=
match
self
.spills
.try_take
()
{
let
conn
=
match
self
.spills
.try_take
()
{
Some
(
conn
)
=>
conn
,
Some
(
conn
)
=>
conn
,
None
=>
Self
::
prepare_conn
(
&
self
.path
,
None
)
.unwrap
(),
None
=>
{
log
::
debug!
(
"read_lock: No recycled connections left, creating new one..."
);
Self
::
prepare_conn
(
&
self
.path
,
None
)
.unwrap
()
}
};
};
// Clone the spill Arc to mark how many spilled connections actually exist.
// Clone the spill Arc to mark how many spilled connections actually exist.
...
@@ -163,8 +168,6 @@ fn read_lock(&self) -> HoldingConn<'_> {
...
@@ -163,8 +168,6 @@ fn read_lock(&self) -> HoldingConn<'_> {
// Get a sense of how many connections exist now.
// Get a sense of how many connections exist now.
let
now_count
=
Arc
::
strong_count
(
&
spill_arc
)
-
1
/* because one is held by the pool */
;
let
now_count
=
Arc
::
strong_count
(
&
spill_arc
)
-
1
/* because one is held by the pool */
;
log
::
debug!
(
"read_lock: all readers locked, creating spillover reader..."
);
// If the spillover readers are more than the number of total readers, there might be a problem.
// If the spillover readers are more than the number of total readers, there might be a problem.
if
now_count
>
self
.readers
.len
()
{
if
now_count
>
self
.readers
.len
()
{
log
::
warn!
(
log
::
warn!
(
...
...
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