Skip to content

Interrupt all running tasks during shutdown#6118

Merged
tobiasdiez merged 10 commits into
masterfrom
fix-delay-task-throttler
Sep 1, 2020
Merged

Interrupt all running tasks during shutdown#6118
tobiasdiez merged 10 commits into
masterfrom
fix-delay-task-throttler

Conversation

@koppor

@koppor koppor commented Mar 14, 2020

Copy link
Copy Markdown
Member

(and don't allow new tasks to be executed)

This fixes #6109.

We invesitgated the shutdown procedure. We think that a thread creating a .sav file is still hanging around AFTER the throttler was shut down. And the .sav file was deleted afterwards. The .sav file was recreated after the deletion...

…s to be executed)

Co-authored-by: Stefan Kolb <stefan-kolb@web.de>

@tobiasdiez tobiasdiez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the same strategy also be used to shutdown the executors in JabRefExecutorService and DefaultTaskExecutor ?

@stefan-kolb

Copy link
Copy Markdown
Member

Not 100 % sure if this works, tho. We need to analyze our total executor architecture, I guess. Maybe we should alos document that in a markdown file as it is crucial for the application.

@calixtus

Copy link
Copy Markdown
Member

Does this affect the WaitForSavedFinishedDialog?

@JabRef JabRef deleted a comment from codecov Bot Mar 31, 2020
@tobiasdiez tobiasdiez marked this pull request as draft April 17, 2020 15:59
@koppor koppor self-assigned this Apr 23, 2020
@koppor

koppor commented Aug 31, 2020

Copy link
Copy Markdown
Member Author

Could also ref #5967.

@koppor

koppor commented Aug 31, 2020

Copy link
Copy Markdown
Member Author

Does this affect the WaitForSavedFinishedDialog?

No, because other sequence in the program flow. (Should I draw Sequence Diagrams? ^^)

@koppor

koppor commented Aug 31, 2020

Copy link
Copy Markdown
Member Author

Should the same strategy also be used to shutdown the executors in JabRefExecutorService and DefaultTaskExecutor ?

Extended to JabRefExecutorService.

Extension to DefaultTaskExecutor seemed to be unnesseary as it works with shutdownNow() (and does not start with shutdown().

@koppor koppor marked this pull request as ready for review August 31, 2020 23:46
Comment thread src/main/java/org/jabref/JabRefExecutorService.java Outdated
}
}
} catch (InterruptedException ie) {
executorService.shutdownNow();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent

}

/**
* Shuts everything down. Upon termination, this method returns.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add to interface

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't do - Added a comment to TaskExecutor

// kill the remote thread
stopRemoteThread();

try {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract try block to method and call it for executorService and lowPriorityExecutorService

if (executorService.awaitTermination(60, TimeUnit.SECONDS)) {
LOGGER.debug("One minute passed again - forced shutdown worked.");
} else {
LOGGER.error("DelayedTaskThrottler did not terminate");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats not the delayed task throttler

public void shutdown() {
// this is non-blocking. See https://stackoverflow.com/a/57383461/873282.
executor.shutdown();
try {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call above helper method

@tobiasdiez tobiasdiez merged commit d1f6c38 into master Sep 1, 2020
@tobiasdiez tobiasdiez deleted the fix-delay-task-throttler branch September 1, 2020 12:17
Siedlerchr added a commit that referenced this pull request Sep 1, 2020
* upstream/master:
  Enable Merging of BibDatabases (#6689)
  Refactor file preferences (#6779)
  Interrupt all running tasks during shutdown (#6118)
  Fixes #6705 , added icon for multiple identifiers (#6809)
  Apply css files correctly to dialogs (#6828)
  Fix link
  Make template more explicit
@Siedlerchr Siedlerchr mentioned this pull request Sep 2, 2020
5 tasks
koppor pushed a commit that referenced this pull request Jul 15, 2022
39fede5 Update associacao-brasileira-de-normas-tecnicas.csl (#6138)
fde7695 Include chapter title (#6140)
1e3d8b4 Update n.d. abbreivation for DGP style (#6136)
ebb728b suffix '.' after first group; changed e-mail (#6135)
eed4f07 Update and rename sciences-po-ecole-doctorale-note-french.csl to scie… (#6127)
f194647 Delete TU Dresden Medizin as requested by library (#6131)
d8423d8 Create entomological-review.csl (#6120)
064a394 Create australasian-journal-of-philosophy.csl (#6063)
a998ded Add composer.json (#5668)
37083c9 Update copernicus-publications.csl (#6062)
694c97b Create chaucer review (#6061)
625a424 Create haffner-style-manual.csl (#6054)
8b7224b make annals-of-allergy-asthma-and-immunology independent (#6041)
710748c Create university-of-pretoria-harvard-theology-religion.csl (#6106)
d16dffd Create health-physics.csl (#6040)
ca9e184 Update style-manual-australian-government.csl (#6119)
e412277 Create chemical-engineering-technology.csl (#6039)
bebdb48 Create bibliothek-forschung-und-praxis.csl (#6038)
29e49cd Update nature.csl (#6117)
891897d fix short title for SBL (#6118)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: 39fede5
koppor pushed a commit that referenced this pull request Aug 1, 2022
c750b6e APA: Put conditional event-title logic in a macro (#6161)
a87414f Remove month from association-for-compuational-linguistics.csl (#6158)
6153db0 Remove issue numbers from BJOC style (#6155)
e231ea3 Bug fix for `event` regression (#6154)
0dab651 Add event-title to other APA styles (#6153)
698cf1c APA: `event-title` and conditional `event` (#6152)
58d3f8f Update vancouver-author-date.csl (#6148)
f1638a9 add substitute to Vancouver author date (#6147)
39fede5 Update associacao-brasileira-de-normas-tecnicas.csl (#6138)
fde7695 Include chapter title (#6140)
1e3d8b4 Update n.d. abbreivation for DGP style (#6136)
ebb728b suffix '.' after first group; changed e-mail (#6135)
eed4f07 Update and rename sciences-po-ecole-doctorale-note-french.csl to scie… (#6127)
f194647 Delete TU Dresden Medizin as requested by library (#6131)
d8423d8 Create entomological-review.csl (#6120)
064a394 Create australasian-journal-of-philosophy.csl (#6063)
a998ded Add composer.json (#5668)
37083c9 Update copernicus-publications.csl (#6062)
694c97b Create chaucer review (#6061)
625a424 Create haffner-style-manual.csl (#6054)
8b7224b make annals-of-allergy-asthma-and-immunology independent (#6041)
710748c Create university-of-pretoria-harvard-theology-religion.csl (#6106)
d16dffd Create health-physics.csl (#6040)
ca9e184 Update style-manual-australian-government.csl (#6119)
e412277 Create chemical-engineering-technology.csl (#6039)
bebdb48 Create bibliothek-forschung-und-praxis.csl (#6038)
29e49cd Update nature.csl (#6117)
891897d fix short title for SBL (#6118)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: c750b6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recovery dialogue on start-up shown although saved and closed properly

4 participants