Closed
Bug 884985
Opened 13 years ago
Closed 13 years ago
Fix race condition in deleting the TMPDIR during boot
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(blocking-b2g:koi+, firefox26 fixed, b2g18 affected)
RESOLVED
FIXED
| blocking-b2g | koi+ |
People
(Reporter: ikumar, Assigned: ikumar)
References
Details
Attachments
(1 file, 1 obsolete file)
|
720 bytes,
patch
|
mwu
:
review+
|
Details | Diff | Splinter Review |
TMPDIR /data/local/tmp directory is getting removed after being created during boot! It turns out that this command in boot event: https://github.com/mozilla-b2g/gonk-misc/blob/master/init.b2g.rc#L20 is occurring after the tmp directory is created here: https://github.com/mozilla-b2g/gonk-misc/blob/master/b2g.sh#L4 so, we end up having no tmp dir after a clean boot. We need to serialize the deletion and creation.
Attachment #764952 -
Flags: review?(mwu)
Assignee: nobody → ikumar
blocking-b2g: --- → koi?
status-b2g18:
--- → affected
tracking-b2g18:
--- → ?
Updated•13 years ago
|
blocking-b2g: koi? → koi+
Updated•13 years ago
|
tracking-b2g18:
? → ---
Updated•13 years ago
|
Attachment #764952 -
Attachment is patch: true
Attachment #764952 -
Attachment mime type: text/x-patch → text/plain
Comment 1•13 years ago
|
||
Comment on attachment 764952 [details] [diff] [review]
Fix race condition in TMPDIR creation
Review of attachment 764952 [details] [diff] [review]:
-----------------------------------------------------------------
::: init.b2g.rc
@@ -16,5 @@
> user root
> group radio
>
> on boot
> - exec /system/bin/rm -r /data/local/tmp
Does doing /data/local/tmp/* instead work? IIRC, we wanted to clear tmp only once on boot rather than every time b2g.sh is called.
Comment 2•13 years ago
|
||
Looks like the globbing wouldn't work as exec is just a wrapper around fork+execl, but this might work:
on boot
exec /system/bin/sh -c '/system/bin/rm -r /data/local/tmp/*'
Do you recall the use case for why clearing tmp on every b2g.sh invocation is a problem?Developer nuisance?
Comment 3•13 years ago
|
||
I think it was just done out of paranoia.
Another option might be to move all of the /data/local/tmp deletion/regeneration/cleanup to init.b2g.rc, and then make sure that stuff executes before we switch to booting services in the main class.
Depends on: 835606
Based to m1's suggestion I tried this:
on boot
exec /system/bin/sh -c '/system/bin/rm -r /data/local/tmp'
And, this seems to work fine. I don't see any indexedDB errors and tmp dir gets created properly.
I didn't want to do globbing as it may mask the issue. In case of race condition it may wipe temp files when other programs were in middle of creating/using it. If we delete the directory then at least there are more chances of the error getting reported.
If we are okay with doing this then I will update the PR.
Discussed with m1 offline and realized why he added the shell there!
Based on mwu's suggestion in comment 3 updating the patch to move the creation of tmp also in init.b2g.rc.
I have also updated the PR: https://github.com/mozilla-b2g/gonk-misc/pull/100
Attachment #764952 -
Attachment is obsolete: true
Attachment #764952 -
Flags: review?(mwu)
Attachment #765541 -
Flags: review?(mwu)
Updated•13 years ago
|
Attachment #765541 -
Flags: review?(mwu) → review+
Comment 6•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
status-firefox26:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•