Bug 248104 - DirFile on NFS change detections
Summary: DirFile on NFS change detections
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: datasources (show other bugs)
Version: 2.0.0
Platform: Unlisted Binaries All
: NOR normal
Target Milestone: 2.0.0
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-17 00:48 UTC by Peter Kümmel
Modified: 2010-11-12 10:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Kümmel 2010-08-17 00:48:57 UTC
Version:           2.0.0
OS:                All

Detection changes of the dirfiles on NFS/mounted dirs.

Reproducible: Didn't try




http://lists.trolltech.com/qt-interest/2008-02/thread00553-0.html

http://mail.kde.org/pipermail/kst/2010-August/018029.html
Comment 2 Peter Kümmel 2010-08-17 01:08:10 UTC
'FAM' on Linux and 'FindFirstChangeNotification()/ReadDirectoryChangesW()' on Windows?
Comment 3 Netterfield 2010-08-17 22:52:39 UTC
After handling more data ..

On 08/17/2010 09:49 AM, Peter Milne wrote:
> On 08/17/2010 12:21 AM, Peter Kümmel wrote:
>>> We'll get by with pressing the "Reload" button so long, I'll try the
>>> threaded timer hack some time.
>>
>> Is it a solution to simply trigger a "Reload" automatically by a timer,
>> without touching any 'watcher' code?
>
> Yes. Simply pressing the button works OK, so a timer maybe would be
> better. Other than every so often the refresh is bad, maybe because Kst
> is reading data as it is being updated at the source. And there'd need
> to be a timer-disable button to stop reloading in the cases where the
> data is static.

Actually, can I change that to a "No" here..

Currently running with a system where it has been acquiring for some
minutes. So the low-rate data file is getting quite long (12000) points
and growing.

On my Linux desktop, running Kst 1.8, plotting the last 100 points on 32
channels, count-from-end 100 frames, the plot is nice and smooth, with
at least one update per second.

Compare with Kst 2.0, running on the same computer, reading the same
network-mounted data source, press refresh, count to 6s. It feels really
slow, and we can only expect it to get slower. Worse sometimes the plot
comes up blank - probably some clash with the data producer process.

> Doing a full Reload is of course forcing Kst to re-read all the data,
> that could end up causing a lot of network traffic, whereas a
> file-change-notify certainly only triggers on change, and, depending on
> how the file read logic is structured, maybe only the new data has to be
> read, rather than _all_ the data?. There's still the possibility of a
> data fetch clashing with a data put, but that may be lower since the two
> actions are now in sequence.

The data source isn't particularly quick, it's a SAMBA export competing
for time on a 400MHz embedded processor that also happens to be
processing a 64MB/s data  stream to memory - so brute force methods are
not advised, it's clearly better to track the head of the files as Kst
1.8 does.


Best regards


Peter.
Comment 4 Netterfield 2010-08-17 23:12:36 UTC
Under 1.x, we polled the files (in the case of dirfiles, we polled a reference
vector through the getdata library).

Polling the file has the advantage of ~always working, though its latency is
limited by the polling rate, and it can use up (an irrelevant amount of) extra
resources.

We need to do this in kst2 as well, at least for remote files if there is a way
to detect if the file is remote.
Comment 5 Peter Kümmel 2010-08-26 16:17:33 UTC
Seems win32 API is unreliable (for remote folders):

MSVC docs: "Notifications may not be returned when calling FindFirstChangeNotification for a remote file system. And QFileSystemWatcher uses FindFirstChangeNotification."

http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/4465cafb-f4ed-434f-89d8-c85ced6ffaa8/

http://stackoverflow.com/questions/151804/system-io-filesystemwatcher-to-monitor-a-network-server-folder-performance-cons

http://stackoverflow.com/questions/57254/
Comment 6 Peter Kümmel 2010-08-26 19:55:14 UTC
On Kubuntu I get this output.

registerWindow Invalid WindowMenu.Registrar! 
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory
QFileSystemWatcher: failed to add paths: /home/synth/.config/ibus/bus
Bus::open: Can not get ibus-daemon's address. 
IBusInputContext::createInputContext: no connection to ibus-daemon
Comment 7 Peter Kümmel 2010-08-28 15:27:04 UTC
There is already a Qt bug:
http://bugreports.qt.nokia.com/browse/QTBUG-8351
Comment 8 Peter Kümmel 2010-08-28 17:21:11 UTC
SVN commit 1169175 by kuemmel:

Always poll on Linux with the help of QFileSystemWatcher for UpdateCheckType 'File',
could be fixed when we know if the file is local or not.
But maybe we remove the code because of all the Qt bugs, hacks and unimplemented Qt features.

CCBUG:248104

 M  +2 -5      datasources/dirfilesource/dirfilesource.cpp  
 M  +24 -3     libkst/datasource.cpp  
 M  +3 -3      libkst/datasource.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1169175
Comment 9 Peter Kümmel 2010-08-30 18:47:45 UTC
SVN commit 1170062 by kuemmel:

Add option to choose update type in data source wizard.

CCBUG: 248104

 M  +5 -0      libkst/datasource.cpp  
 M  +2 -0      libkst/datasource.h  
 M  +41 -0     libkstapp/datawizard.cpp  
 M  +2 -0      libkstapp/datawizard.h  
 M  +53 -2     libkstapp/datawizardpagedatasource.ui  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1170062
Comment 10 Peter Kümmel 2010-08-31 19:58:26 UTC
SVN commit 1170371 by kuemmel:

Make changing update type also possible after using the wizard.

BUG: 248104

 M  +4 -2      changedatasampledialog.cpp  
 M  +2 -1      datawizard.cpp  
 M  +37 -0     vectordialog.cpp  
 M  +2 -0      vectordialog.h  
 M  +144 -76   vectortab.ui  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1170371
Comment 11 Peter Kümmel 2010-11-12 10:42:39 UTC
These bugs are solved with 2.0.0