Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#6026 closed defect (fixed)

Destroying VMs shouldn't delete the file where their information is stored

Reported by: minondoa Owned by: minondoa
Priority: major Milestone: DRM4G-2.6.0
Component: DRM4G Keywords: drm4g, vm, destroy, pickle


After having created a VM, the necessary information to eliminate it is saved in a file.
When running the command "drm4g resource destroy" to destroy the created VMs, this file is deleted.
The problem is that if for whatever reason, the VMs weren't destroyed, the file would get destroyed anyways, so it would be impossible to try again.

When destroying the VMs, a thread is created for each one of them. Instead of deleting the file, have each one of the threads delete the entry of their respective VM from the file, only if it has been successful destroying its VM.

Change History (3)

comment:1 Changed 6 years ago by minondoa

  • Resolution set to fixed
  • Status changed from new to closed

Now each thread deletes its own entry in the file. The problem is that the solution isn't the most efficient.
The file is produced by serializing the objects using the pythons module "pickle", but this module doesn't support any way of deleting an entry. So right now each thread reads the whole file, de-serializes all the objects, deletes the one it doesn't need and then serializes the rest again into the file.
This will have to be reviewed in the future.

comment:2 Changed 5 years ago by minondoa

  • Keywords destroy added; destoy removed

comment:3 Changed 5 years ago by minondoa

  • Milestone changed from DRM4G_VO to DRM4G-2.6.0

Milestone renamed

Note: See TracTickets for help on using tickets.