Skip to content

Remove XFTP receive chunks before reporting completion - #1949

Open
angerman wants to merge 1 commit into
masterfrom
angerman/xftp-completion-order
Open

angerman wants to merge 1 commit into
masterfrom
angerman/xftp-completion-order

Conversation

@angerman

Copy link
Copy Markdown
Contributor

A completed XFTP receive can let its consumer delete the shared receive directory while the worker still removes encrypted chunks. Finish that cleanup before publishing RFDONE, retaining the existing foreground wait and database-completion order. The redirect handling added in #1932 stays unchanged.

The regression performs a real transfer, holds the decrypt worker until progress is drained, then fills a one-slot event queue. It checks that encrypted chunks are gone while completion is blocked, then receives completion, deletes the receive immediately, and checks that the worker becomes idle without an error. It adds no sleeps.

Validation: the focused native ARM64/GHC 9.14 fixture fails on current master at the chunk-directory assertion and passes with this fix (one example each). It compiles the current XFTP test and HasTestEnv harness with cached dependencies and exact views of the active helper definitions. A full current-master package build remains unverified: the cached older MQ library lacks the newer ServerConfig.maxClientCmdWait field needed by unrelated SMP test configuration.

@epoberezkin

Copy link
Copy Markdown
Member

Probably better to catch any errors on deletion and report completion anyway if deletion throws?...

notify c rcvFileEntityId $ RFDONE fsSavePath
-- RFDONE lets the consumer delete the shared receive prefix.
-- Finish chunk cleanup before publishing completion.
lift $ forM_ tmpPath (removePath <=< toFSFilePath)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lift $ forM_ tmpPath (removePath <=< toFSFilePath)
lift $ forM_ tmpPath (removePath <=< toFSFilePath) `catchOwn'` \e -> logError ("Error deleting received chunks" <> tshow e)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants