Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Autopsy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Autopsy
Commits
b9ac7a9d
Commit
b9ac7a9d
authored
3 years ago
by
Greg DiCristofaro
Browse files
Options
Downloads
Patches
Plain Diff
shutdown thread executor and catch throwable
parent
6d78d25a
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
Core/src/org/sleuthkit/autopsy/imagewriter/ImageWriter.java
+5
-2
5 additions, 2 deletions
Core/src/org/sleuthkit/autopsy/imagewriter/ImageWriter.java
with
5 additions
and
2 deletions
Core/src/org/sleuthkit/autopsy/imagewriter/ImageWriter.java
+
5
−
2
View file @
b9ac7a9d
...
...
@@ -30,6 +30,7 @@
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.ExecutorService
;
import
java.util.logging.Level
;
import
org.netbeans.api.progress.ProgressHandle
;
import
org.openide.util.NbBundle.Messages
;
...
...
@@ -143,6 +144,7 @@ public void propertyChange(PropertyChangeEvent evt) {
})
private
void
startFinishImage
(
String
dataSourceName
)
{
ExecutorService
executor
=
Executors
.
newSingleThreadExecutor
();
synchronized
(
currentTasksLock
)
{
if
(
isCancelled
)
{
return
;
...
...
@@ -186,7 +188,7 @@ private void startFinishImage(String dataSourceName) {
// The added complexity here with the Future is because we absolutely need to make sure
// the call to finishImageWriter returns before allowing the TSK data structures to be freed
// during case close.
finishTask
=
Executors
.
newSingleThreadE
xecutor
()
.
submit
(
new
Callable
<
Integer
>()
{
finishTask
=
e
xecutor
.
submit
(
new
Callable
<
Integer
>()
{
@Override
public
Integer
call
()
throws
TskCoreException
{
try
{
...
...
@@ -199,7 +201,7 @@ public Integer call() throws TskCoreException {
caseDb
.
updateImagePath
(
settings
.
getPath
(),
dataSourceId
);
}
return
result
;
}
catch
(
T
skCoreException
ex
)
{
}
catch
(
T
hrowable
ex
)
{
logger
.
log
(
Level
.
SEVERE
,
"Error finishing VHD image"
,
ex
);
//NON-NLS
return
-
1
;
}
...
...
@@ -215,6 +217,7 @@ public Integer call() throws TskCoreException {
try
{
// The call to get() can happen multiple times if the user closes the case, which is ok
result
=
finishTask
.
get
();
executor
.
shutdownNow
();
}
catch
(
InterruptedException
|
ExecutionException
ex
)
{
logger
.
log
(
Level
.
SEVERE
,
"Error finishing VHD image"
,
ex
);
//NON-NLS
}
...
...
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