Skip to content

Ensure that files are handled safely in recording scripts - #9857

Merged
ffdixon merged 2 commits into
bigbluebutton:v2.2.x-releasefrom
SRCF:patch-2
Jun 17, 2020
Merged

ffdixon merged 2 commits into
bigbluebutton:v2.2.x-releasefrom
SRCF:patch-2

Conversation

@matiasilva

@matiasilva matiasilva commented Jun 17, 2020 •

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR fixes an issue with reading and writing files.
File.open is used which means that a file will remain open
unless explicilty closed or the program exit. This doesn't work
for an NFS mount as the scripts try to "rm -rf" when the file
is still open. This commit fixes that by replacing all .opens
with .reads in 3 locations.

Closes Issue(s)

Fixes #9062 and #9110 (duplicates)

Motivation

Our BBB hosts only have a maximum disk size of 25GB so we could not store recordings locally. An external NFS mount was used for the Kurento, FreeSWITCH and other directories to ensure that the entire process still worked. However, we ran into this issue and the existing fixes in the issues were quick hacks that did not solve the issue at large. It is also good practice to close files after using them. It may be necessary to apply this to all scripts in record-and-playback but for us, only these were necessary as we archive and perform sanity on the BBB hosts but process and publish on another machine.

More

Use the following regexp:
regexp: '^(.(Nokogiri::XML|Hash.from_xml))(File.open((.)$'
replace: '\1(File.read(\3'

mw781 added 2 commits June 17, 2020 11:09
This commit fixes an issue with reading and writing files.
File.open is used which means that a file will remain open
unless explicilty closed or the program exit. This doesn't work
for an NFS mount as the scripts try to "rm -rf" when the file
is still open. This commit fixes that by replacing all .opens
with .reads
@ffdixon
ffdixon merged commit 44dcfc6 into bigbluebutton:v2.2.x-release Jun 17, 2020
@defnull

defnull commented Aug 12, 2020

Copy link
Copy Markdown
Contributor

I think this fix was incomplete. The process script was fixed, but the publish script still opens files without closing them before calling FileUtils.rm_r(Dir.glob("#{target_dir}/*")).

defnull added a commit to defnull/bigbluebutton that referenced this pull request Aug 12, 2020
PR bigbluebutton#9857 was incomplete and did not completely fix the issues described in bigbluebutton#9062 and bigbluebutton#9110 (dublicate).
defnull added a commit to defnull/bigbluebutton that referenced this pull request Dec 7, 2020
PR bigbluebutton#9857 was incomplete and did not completely fix the issues described in bigbluebutton#9062 and bigbluebutton#9110 (dublicate).
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.

3 participants