davidmoten / rxjava-file

RxJava observables for files including NIO events
Apache License 2.0
82 stars 17 forks source link

OperatorWatchServiceEvents.java:84 blocks indefinately #7

Open chrisatcodedmarkets-zz opened 9 years ago

chrisatcodedmarkets-zz commented 9 years ago

Hi, all (but one) test fails for me. I've debugged the code, and it hangs on the watchService.Take() call. There's never an event, on my system, I guess—which I understand to be platform dependent. FYI, I'm running OSX Yosemite.

davidmoten commented 9 years ago

I've had a brief look at that Operator and this whole project needs a bit of work as its assumptions predate backpressure. I doubt that it's related to your problem though. I don't have OSX to test on. Can you investigate a bit while I do some cleaning up of this project?

chrisatcodedmarkets-zz commented 9 years ago

I'm probably going to check out Apache Flink first, which is an alternative to what I was going to use your code for. Since Flink also uses file watcher for unbounded streams, the fix for your code may exist there (i.e. how to get watcher events to work on OSX). I'll have a look when I can.

davidmoten commented 9 years ago

Ta.

On 6 October 2015 at 15:25, Chris Brinkman notifications@github.com wrote:

I'm probably going to check out Apache Flink first, which is an alternative to what I was going to use your code for. Since Flink also uses file watcher for unbounded streams, the fix for your code may exist there (i.e. how to get watcher events to work on OSX). I'll have a look when I can.

— Reply to this email directly or view it on GitHub https://github.com/davidmoten/rxjava-file/issues/7#issuecomment-145738460 .

davidmoten commented 9 years ago

I've deployed 0.3.3 to Maven Central that has backpressure fixes and got the tests to pass on Windows 7as well as linux (my primary target). I did need to up the timeouts and fully reopen an close PrintStreams to get Windows to notice. Could you try and build master on your machine for me to see if tests pass or fail and put output here? Thanks!

Romanow88 commented 8 years ago

Hi, I have the same issue (0.4 from maven).

With just the base set up:

File file = new File(".\\some.log"); Observable<String> newLines = FileObservable.tailer() .file(file) .startPosition(file.length()) .sampleTimeMs(1000) .chunkSize(8192) .utf8() .tailText(); newLines.subscribe(System.out::println);

I can't get anything by just writing to the file via a notepad. The thread locks on first call to WatchService.take() and just sits there.

Any ideas?

Romanow88 commented 8 years ago

The above mentioned situation does not happen if just .tail() is used. There is probably a bug how you are building the line observable.