Bug 571429 - Working with a workspace on a network drive
Summary: Working with a workspace on a network drive
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 4.18   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-23 05:50 EST by Matthias Becker CLA
Modified: 2022-02-17 09:28 EST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Becker CLA 2021-02-23 05:50:44 EST
When a user uses a workspace that is located on a network drive (instead of storing it on the local disk) this can impact performance heavily.

Do we have some guidance saying that user should *not* so that?

Is there a possibility to detect that the workspace is a none-local one? And if yes would it may sense to present a warning to the user about that fact?
Comment 1 Andrey Loskutov CLA 2021-02-24 10:18:50 EST
On Linux this seem to be not trivial.

For example, my home is on NFS, but that what do we see via stat:
$ stat --file-system --format=%T /home 
autofs

*what* is behind autofs we don't know yet.

And following also doesn't help me further:
$ mount -l
...
/usr/bin/autohome.sh on /home type autofs (rw,relatime,fd=12,pgrp=4010,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=40325)

I'm open for ideas too, we have a pretty important customer which has unbelievable bad NFS and I would also like to report that fact somewhere so users don't try to work in workspaces located on that NFS :-)
Comment 2 Rolf Theunissen CLA 2021-02-25 03:32:01 EST
A related discussion is in Bug 507401, mainly focusing on the Windows side of the story.
Comment 3 Andrey Loskutov CLA 2021-04-15 06:17:22 EDT
My colleague pointed me to df command:

$ df --output=fstype ~ | tail -1
nfs

$ df --output=fstype /tmp | tail -1
xfs

See https://man7.org/linux/man-pages/man1/df.1.html

That seem to deliver exactly what we need on Linux. I think it would be worth to add the warning for Linux, may be that will also work on Mac too (I believe they have "df" command, not sure if it supports that above).

@Lakshmi: I believe you have Mac, could you please check if commands above work for you too?
Comment 4 Thomas Wolf CLA 2021-04-15 06:44:28 EDT
(In reply to Andrey Loskutov from comment #3)
> My colleague pointed me to df command:
> 
> $ df --output=fstype ~ | tail -1
> nfs
> 
> $ df --output=fstype /tmp | tail -1
> xfs
> 
> See https://man7.org/linux/man-pages/man1/df.1.html
> 
> That seem to deliver exactly what we need on Linux. I think it would be
> worth to add the warning for Linux, may be that will also work on Mac too (I
> believe they have "df" command, not sure if it supports that above).
> 
> @Lakshmi: I believe you have Mac, could you please check if commands above
> work for you too?

No, they don't. Doesn't know --output.

But does one have to use an external command? Can't one get this info via Java FileStore.type()?
Comment 5 Andrey Loskutov CLA 2021-04-15 08:05:41 EDT
(In reply to Thomas Wolf from comment #4)
> No, they don't. Doesn't know --output.
> 
> But does one have to use an external command? Can't one get this info via
> Java FileStore.type()?

public class A {
	public static void main(String[] args) throws Exception {
		FileStore st1 = Files.getFileStore(Paths.get("/tmp"));
		System.out.println(st1.type());
		FileStore st2 = Files.getFileStore(Paths.get("/home/aloskuto"));
		System.out.println(st2.type());
	}
}

prints

rootfs
nfs

on my RHEL 7.4 / Java 11.

Is closer to what we want.
So the question is: what does that return on Windows / Mac NFS?
Comment 6 Andrey Loskutov CLA 2021-04-15 08:12:07 EDT
(In reply to Andrey Loskutov from comment #5)
> Is closer to what we want.
> So the question is: what does that return on Windows / Mac NFS?

... and other network file systems like AFS etc on Linux. I don't have afs/openafs server to test with...

But one can assume some black/while lists for "known" network file systems that we could improve with the time.

So a small popup could appear using new (fully undocumented) org.eclipse.jface.notifications.AbstractNotificationPopup API once we detect "NFS" based location.
Comment 7 Andrey Loskutov CLA 2021-04-16 09:35:32 EDT
Note: not only workspace (.metadata) can be on the network drive, but the projects itself (and linked folders inside projects) too, and all that could affect performance in same way.

It is "easy" to check (and report) if workspace is on NFS, but things don't scale for projects & folders anymore. 

I have a workspace with ~200 projects - assuming I would be so crazy to put all them on NFS, should I get ~200 notifications? One notification with ~200 warnings? Same for linked folders inside projects...

For projects & folders I can imagine, we can create a warning marker - but we also want to manage this marker if project / folder changes location... That is starting to be complicated.

So viable approach would be: notification for workspace location on NFS + markers per project on NFS and don't warn for folders yet at all (that may not scale / bee too complex).
Comment 8 Andrey Loskutov CLA 2021-04-17 06:44:57 EDT
Tried FileStore.type() on two different mounts on Windows 10, the only result is that FileStore.type() returns always "NTFS" even if one of the mounts is on Linux workstation with XFS and other on file server. I see that the sun.nio.fs.WindowsFileStore.volType has a type of "4" (== sun.nio.fs.WindowsConstants.DRIVE_REMOTE) but that is private field and not accessible.

The checker offered in bug 507401 comment 8 https://gist.github.com/digulla/31eed31c7ead29ffc7a30aaf87131def also doesn't detect those locations as network.

But Windows user could simply move to Linux or Mac :-)
Comment 9 Lakshmi P Shanmugam CLA 2021-04-20 16:19:51 EDT
(In reply to Andrey Loskutov from comment #3)
> My colleague pointed me to df command:
> 
> $ df --output=fstype ~ | tail -1
> nfs
> 
> $ df --output=fstype /tmp | tail -1
> xfs
> 
> See https://man7.org/linux/man-pages/man1/df.1.html
> 
> That seem to deliver exactly what we need on Linux. I think it would be
> worth to add the warning for Linux, may be that will also work on Mac too (I
> believe they have "df" command, not sure if it supports that above).
> 
> @Lakshmi: I believe you have Mac, could you please check if commands above
> work for you too?

@Andrey, sorry couldn't respond earlier, was on vacation.
Comment 10 Andrey Loskutov CLA 2021-05-10 04:13:59 EDT
We are probably going to implement some kind of warnings in our product first.

The platform specific code probably can be contributed either per fragments if native code is affected, or per different classes if the checks can be realized in plain Java.

Also that seem to be a good case for extension point so that third party could add/modify the way how checks are actually performed on respective platform and may be how the warnings should look like (wording, may be extra "on NFS" addition to the workspace name etc).

I can't guarantee, may be we will provide some patches later once we've found an agreed solution to do this in our product.

I also think that it is OK to contribute checks for one platform only, if the way how we do that is open for later addition on other platforms.
Comment 11 Sebastian Zarnekow CLA 2022-02-17 09:10:25 EST
Hello Andrey,

that sounds like a very worthy addition to prevent users from seeing unexpected worrisome behavior. Did you make already some steps towards an implemenation?

Best
Sebastian
Comment 12 Andrey Loskutov CLA 2022-02-17 09:28:57 EST
(In reply to Sebastian Zarnekow from comment #11)
> Hello Andrey,
> 
> that sounds like a very worthy addition to prevent users from seeing
> unexpected worrisome behavior. Did you make already some steps towards an
> implemenation?

Yes, we did it in our custom product. The code is Linux specific (uses some shell commands to check for FS type) and isn't meant to be portable in the current form (too much product specific dependencies).

We've extended the workspace prompt to show a notification hint in the text box and we've added JFace based notification popup after startup - both give user a warning that working on NFS is a bad idea.

I think it could be possible to generalize this so it could be OS independent amd moved to platform, but it will be for sure a bigger task. We can check internally how much it will cost. And for sure we will not be able to provide Windows or Mac ports.