Bug 446023 - AsynchronousFileCacheBacking should make daemons out of the created thread(s)
Summary: AsynchronousFileCacheBacking should make daemons out of the created thread(s)
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: LTWeaving (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-06 04:53 EDT by Lyor Goldstein CLA
Modified: 2014-10-08 03:25 EDT (History)
1 user (show)

See Also:


Attachments
Suggested patch (4.76 KB, patch)
2014-10-08 03:24 EDT, Lyor Goldstein CLA
lgoldstein: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lyor Goldstein CLA 2014-10-06 04:53:35 EDT
The current implementation uses the Executors.newSingleThreadExecutor() call in order to create the background thread responsible for the asynchronous write(s). This call creates non-daemon threads which prevent the application from exiting -> the thread(s) should be daemon(s) since we do not want the weaving to affect the application start/stop.

In order to prevent the danger that the thread will be stopped while it is updating something, a derived Thread class should be used (via a special ThreadFactory) that attempts to complete any ongoing I/O operation before (gracefully) terminating.
Comment 1 Andrew Clement CLA 2014-10-07 20:01:36 EDT
Are you in a position to give me a patch or pull request for that change?
Comment 2 Lyor Goldstein CLA 2014-10-08 03:24:24 EDT
Created attachment 247703 [details]
Suggested patch
Comment 3 Lyor Goldstein CLA 2014-10-08 03:25:07 EDT
Added patch (not compiled or tests, but I am sure you can manage any minor errors that may be reported...)