Skip to content

fix: NFS-safe cleanup in notes and podcast publish scripts - #24772

Closed
ffdixon wants to merge 1 commit into
bigbluebutton:v3.0.x-developfrom
ffdixon:fix/nfs-publish-rmdir
Closed

ffdixon wants to merge 1 commit into
bigbluebutton:v3.0.x-developfrom
ffdixon:fix/nfs-publish-rmdir

Conversation

@ffdixon

@ffdixon ffdixon commented Mar 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Replace FileUtils.rm_r(dir) with FileUtils.rm_r(Dir.glob("#{dir}/*")) in notes.rb and podcast.rb publish scripts
  • On NFS4 filesystems, rmdir can fail with Errno::ENOTEMPTY when file deletions haven't been flushed from the NFS client cache; deleting contents instead of the directory itself avoids this
  • Matches the pattern already used by presentation.rb

Test plan

  • Verified that recording random-8987579 published successfully with no Errno::ENOTEMPTY
  • Confirm no regressions on non-NFS filesystems (standard ext4/xfs)

🤖 Generated with Claude Code

…safe)

On NFS4 filesystems, FileUtils.rm_r(dir) can fail with
Errno::ENOTEMPTY because file deletions haven't been flushed from the
NFS client cache before the final rmdir. Delete directory *contents*
via Dir.glob instead—matching the pattern already used by video.rb and
presentation.rb.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Two publish scripts were modified to alter their cleanup operations. The FileUtils.rm_r() calls that previously removed entire directory structures were replaced with FileUtils.rm_r(Dir.glob(".../*")) calls that delete only the immediate contents of those directories. This change applies to both the "Removing processed files" and "Removing published files" steps in each script, preserving the directory structures themselves while purging their contents.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: replacing directory removal with NFS-safe content-only deletion in the notes and podcast publish scripts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly explains the changes made to both notes.rb and podcast.rb files, the specific NFS filesystem issue being addressed, and includes a concrete test plan with verification performed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can generate a title for your PR based on the changes with custom instructions.

Set the reviews.auto_title_instructions setting to generate a title for your PR based on the changes in the PR with custom instructions.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary antobinary added this to the Release 3.0 milestone Mar 19, 2026
@antobinary
antobinary requested a review from kepstin March 19, 2026 15:18
@kepstin

kepstin commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

The cleanup needs to delete the directories themselves. "rm -r" should work on an NFS directory tree, the "client cache" explanation makes no sense.

The usual reason for a directory deletion failing is that there is an open file within the directory which has resulted in the NFS server creating a special hidden file to keep the directory open. Perhaps somewhere earlier in the recording scripts a file is opened but never closed?

@kepstin

kepstin commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

From a quick inspection, I think there is a leaked open file in the target directory on

https://github.com/ffdixon/bigbluebutton/blob/9d694f2843f4409b6ba2962085255cf9d42fce13/record-and-playback/notes/scripts/publish/notes.rb#L88

which might be the cause of the issues on NFS. There are likely similar problems with the other scripts.

@antobinary
antobinary changed the base branch from v3.0.x-release to v3.0.x-develop April 24, 2026 14:54
@github-actions

Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@antobinary

Copy link
Copy Markdown
Member

Related: #25106 forcing the removal.

@defnull

defnull commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Maybe rm_rf (#25106) is not enough. I searched a bit and found #9857 which suggests that @kepstin may be correct. NFS may require closing files properly before deleting their parent directory.

@antobinary

Copy link
Copy Markdown
Member

Closed via #25952 in BBB 4.0. Thank you!

@antobinary antobinary closed this Oct 15, 2026
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.

4 participants