[GRASS-dev] [GRASS GIS] #3635: Suspicious use and cleanup of the mapset tempoary directory

GRASS GIS trac at osgeo.org
Sat Sep 15 20:13:57 PDT 2018


#3635: Suspicious use and cleanup of the mapset tempoary directory
-------------------------+-------------------------------------------------
  Reporter:  wenzeslaus  |      Owner:  wenzeslaus
      Type:  defect      |     Status:  new
  Priority:  normal      |  Milestone:  7.8.0
 Component:  Startup     |    Version:  svn-trunk
Resolution:              |   Keywords:  init grass.py clean_temp .tmp temp
       CPU:              |  g.mapset wxGUI rendering
  Unspecified            |   Platform:  All
-------------------------+-------------------------------------------------

Comment (by wenzeslaus):

 Now only the `clean_temp` tool is used. It is called through
 `atexit.register()`. `clean_temp` always cleans the current mapset
 (specified in an "rc file" pointed to by GISRC variable as for all GRASS
 modules).

 What is now possible but was broken before:

 1. Start session I in mapset A.
 2. Switch session I to mapset B.
 3. Start session II in mapset A.
 3. Start processes in session II (mapset A).
 4. Exit session I (from mapset B).
 5. Running processes in session II (mapset A) still have their temporary
 files.

 Before r73336, the processes in session II would fail because their
 temporary files were deleted. The positive aspect of this behavior was
 that the cleanup of the original mapset would take care of the files left
 behind by GUI which was putting some of its rendering files to the mapset
 temporary directory, but this is no longer needed after r73334 (#3637).

 By relying only on `clean_temp` and not deleting whole `.tmp` manually
 (leaving aside the mapset switching problem), there are two changes in
 behavior:

 1. The `.tmp` directory and the `$HOSTNAME` subdirectory are never deleted
 once created. The content is cleaned by `clean_temp` which applies its
 rules rather than deleting all.
 2. When a process does not end in a standard way, e.g. by pressing
 ''Stop'' button in the wxGUI, the process may still show up when
 `clean_temp` tests if the process associated with the file by PID in the
 file name is still running (by sending the null signal; applies only to
 other than `__MINGW32__` systems). Consequently, some files may be left
 behind when exiting the session (or changing mapset - that did not
 change). These files should be usually clean by the next session running
 in that mapset.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3635#comment:6>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list