Bug 453050 - Temporary images files used in platesolving not being deleted
Summary: Temporary images files used in platesolving not being deleted
Status: REPORTED
Alias: None
Product: kstars
Classification: Applications
Component: general (other bugs)
Version First Reported In: 3.5.8
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Rob
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-26 13:09 UTC by sequel.county_0d
Modified: 2022-06-06 15:09 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sequel.county_0d 2022-04-26 13:09:59 UTC
SUMMARY
***

When platesolving in ekos temporary image files are created in /tmp of the form solve*.fits these files are not removed leading to the file system filling up

STEPS TO REPRODUCE
1.  go into align module 
2.  select slew to target and press capture&solve
3.  Check /tmp

OBSERVED RESULT
Multiple solve*.fits files accumulate in /tmp


EXPECTED RESULT
Files are deleted once used.

Looking at the source it appears that it tries to delete temporary files but the patterns used are not ones that would match these files . Would also think it needs to use its own directory to prevent accidental matches with other files in /tmp

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma:  Astroberry 2.0.4
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Raspberry Pi 4 with 4gb
Comment 1 Rob 2022-06-05 15:30:10 UTC
The .solved and .cancel files are REALLY critical for external astrometry.net.  This is not a bug if you are referring to those two file types.  The external program astromety.net uses those files to determine that it should shut itself down.  (I already use a kill command but that is not enough) If those files are not created and left in place, external astrometry.net will keep running, possibly with multiple processes of astrometry-engine, and will take up lots of cpu time and memory while they continue to try and solve when the image was already solved or aborted.  Yes I definitely intended to make stellarsolver delete all the other temporary files that were created both by stellarsolver and other external processes such as astap and astrometry.net, but the solved and cancel files have to stick around.  The good news is that they are basically empty files.  I also made the latest version of stellarsolver share solved and cancel files when doing a parallel solve so it should make far fewer files now.  But I can't delete those files unfortunately.  I can't even delete them later on a timer since we have no idea when the astrometry engine will shut down.  

If you are referring to another type of file, such as a fits file or a config file, then it might have been a bug.  I did do some revisions to the temporary file deletion code and related issues in the latest version of stellarsolver, so please check to see if that has been resolved if that is the case.
Comment 2 sequel.county_0d 2022-06-06 15:09:34 UTC
(In reply to Rob from comment #1)
> The .solved and .cancel files are REALLY critical for external
> astrometry.net.  This is not a bug if you are referring to those two file
> types.  The external program astromety.net uses those files to determine
> that it should shut itself down.  (I already use a kill command but that is
> not enough) If those files are not created and left in place, external
> astrometry.net will keep running, possibly with multiple processes of
> astrometry-engine, and will take up lots of cpu time and memory while they
> continue to try and solve when the image was already solved or aborted.  Yes
> I definitely intended to make stellarsolver delete all the other temporary
> files that were created both by stellarsolver and other external processes
> such as astap and astrometry.net, but the solved and cancel files have to
> stick around.  The good news is that they are basically empty files.  I also
> made the latest version of stellarsolver share solved and cancel files when
> doing a parallel solve so it should make far fewer files now.  But I can't
> delete those files unfortunately.  I can't even delete them later on a timer
> since we have no idea when the astrometry engine will shut down.  
> 
> If you are referring to another type of file, such as a fits file or a
> config file, then it might have been a bug.  I did do some revisions to the
> temporary file deletion code and related issues in the latest version of
> stellarsolver, so please check to see if that has been resolved if that is
> the case.

I’ve just checked the code and the lines which I believe do the delete are still there. The files that I believe need deleting are the .fits files rather than these others you are on about. The code is in align.cpp and has a comment saying Remove temporary FITS file left before by solver.