Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quasar
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
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
Jens Nolte
quasar
Commits
5e3ba713
Commit
5e3ba713
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Add exception message when collectGarbage fails
parent
c48e2da6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Quasar/ResourceManager.hs
+7
-3
7 additions, 3 deletions
src/Quasar/ResourceManager.hs
with
7 additions
and
3 deletions
src/Quasar/ResourceManager.hs
+
7
−
3
View file @
5e3ba713
...
...
@@ -352,8 +352,9 @@ instance IsDisposable DefaultResourceManager where
\
ex
->
do
-- Disposable failed so it should be removed
atomically
(
void
$
tryTakeTMVar
var
)
-- This will only throw if the parent is disposed, which would be an illegal state
-- TODO wrap in a 'DisposeException'
throwToResourceManager
resourceManager
ex
pure
()
isDisposed
resourceManager
=
...
...
@@ -383,7 +384,9 @@ newUnmanagedDefaultResourceManager parentResourceManager = liftIO do
}
void
$
mask_
$
forkIOWithUnmask
\
unmask
->
unmask
(
freeGarbage
resourceManager
)
`
catchAll
`
throwToResourceManager
resourceManager
unmask
(
freeGarbage
resourceManager
)
`
catchAll
`
\
ex
->
throwToResourceManager
resourceManager
(
userError
(
"freeGarbage failed for DefaultResourceManager: "
<>
displayException
ex
))
pure
$
toResourceManager
resourceManager
...
...
@@ -411,7 +414,8 @@ freeGarbage resourceManager = go
else
awaitAny
(
listChanged
:|
awaitables
)
-- Checking entries for completion has to be done in IO.
-- Completion is then queried with `entryIsEmpty` during the following STM transaction.
-- Completion is queried with `entryIsEmpty` during the following STM transaction for legacy reasons (the resource
-- manager once did allow to add resources while disposing). This could be simplified now.
checkEntries
=<<
atomically
(
readTVar
entriesVar'
)
join
$
atomically
$
do
...
...
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