Is Deletion in RamFileSystem (RamPath.delete()) Synchronous?
45 views
Skip to first unread message
Randall R Schulz
unread,
Mar 19, 2013, 2:19:40 PM3/19/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala-i...@googlegroups.com
Hi,
I'm seeing occasional occurrences of RamPath.delete() succeeding (throwing no exception) with an immediately following RamPath.exists (on the same RamPath, of course) returning true. It occurs fairly often on my Jenkins server but rarely on my laptop, so I get quite a few test failures on the build automation system but it's hard to reproduce on my development system.
Anyway, I'm wondering whether the call to delete() is synchronous? Might the occasional discrepancy between delete() and exists be a consequence of a race condition?
Randall Schulz
jesse....@gmail.com
unread,
Mar 20, 2013, 6:09:56 AM3/20/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala-i...@googlegroups.com
I would not be surprised if there are race conditions. I use the RamFileSystem primarily for testing in synchronous tests.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala-i...@googlegroups.com
Jesse,
Perhaps I should clarify... I'm not accessing the RamFileSystem instance from multiple threads.
Are you saying that RamFileSystem is not thread-safe?
Randall Schulz
jesse....@gmail.com
unread,
Mar 21, 2013, 11:01:20 AM3/21/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala-i...@googlegroups.com
I am saying that I took basic care so it should be mostly thread safe, but that aspect has not been really carefully tested. Making the FS be an actor would be a good way to make it completely safe. To be honest the RamFS could use a better implementation. But since it was mostly for my tests I didn’t take the time to exercise all corner cases.
Jesse
--
Randall R Schulz
unread,
Mar 21, 2013, 11:10:34 AM3/21/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala-i...@googlegroups.com
OK, but again, I'm not using it in a multi-threaded setting. I call delete(), no exception is thrown and immediately thereafter exists returns true. Is this normal? If so, what's the right way to confirm that deletion succeeded?
Randall Schulz
jesse....@gmail.com
unread,
Mar 22, 2013, 3:40:02 AM3/22/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala-i...@googlegroups.com
Sorry for going off on a rant. No that shouldn’t be normal.
From: Randall R Schulz Sent: March 21, 2013 4:10 PM To:scala-i...@googlegroups.com Subject: Re: Is Deletion in RamFileSystem (RamPath.delete()) Synchronous?