Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pnuu opened this issue Aug 24, 2022 · 1 comment
Open

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

pnuu opened this issue Aug 24, 2022 · 1 comment
Labels

Comments

@pnuu
Copy link
Member

pnuu commented Aug 24, 2022

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
@pnuu pnuu added the bug label Aug 24, 2022
@pnuu
Copy link
Member Author

pnuu commented Aug 24, 2022

Hmm, actually self._add_to_deleter() is present in RequestManager.ack(), but maybe it's not being accessed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant