Skip to content

Decompressed files are only deleted on Server only if they are moved #125

@pnuu

Description

@pnuu

Describe the bug
If file decompression is run on the Trollmoves Server, the files will always be decompressed to a working directory (/tmp by default on Linux). These decompressed files are deleted only if they have been transferred.

To Reproduce
Run a Trollmoves Server watching a directory where compressed files are arriving, and have it decompress the files.

Expected behavior
All the decompressed files should be deleted after remove_delay (by default 30 seconds) has been passed.

Actual results
The files are scheduled for deletion only if they are requested and transferred successfully. The relevant parts of trollmoves.server module are:

  1. https://github.com/pytroll/trollmoves/blob/main/trollmoves/server.py#L252
    which is called from
  2. error_message = self._move_file(pathname, message, rel_path)

    which is called from
  3. new_msg = self._move_files(message)

    which is called from
  4. Thread(target=self.reply_and_send, args=(self.push, address, message)).start()

    which is called from
  5. self._process_request(Message(rawstr=payload), address)

    which is called from
  6. self._run()

    which is called from
  7. server.run()

So due to the scheduling for deletion happening only for push messages (point 5 above), the files will remain in the working directory when there are no push requests. This can happen when

  • the Client(s) are stopped/crashed
  • there are multiple Servers hosting the data, so only one of the receives the push request

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions