Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polling and double changes in 0.5.0 under OS X 10.8 #62

Closed
brief opened this issue Sep 7, 2012 · 26 comments
Closed

Polling and double changes in 0.5.0 under OS X 10.8 #62

brief opened this issue Sep 7, 2012 · 26 comments

Comments

@brief
Copy link

brief commented Sep 7, 2012

Listen 0.5.0 breaks a few things for me under Mountain Lion:

  • Listen only polls changes, no matter how I use it
  • Listen registers each change twice

Reverting to Listen 0.4.7 fixes these issues on my machine.

@meeech
Copy link

meeech commented Sep 8, 2012

I also see double posting of changes when in polling mode
osx 10.6.8

@brief you might want to keep an eye on #61, since it seems you are having same issue (good to know its not only 10.6 people :) )

@philmunt
Copy link

philmunt commented Sep 8, 2012

I have exactly this issue on mountain lion, but reverting to 0.4.7 didn't help.
EDIT: I was wrong 0.4.7 seems to be working

@datanoise
Copy link

Same thing. Reverting to 0.4.7 fixed the issue. Waiting for the fix...

@Maher4Ever
Copy link
Contributor

I just pushed a commit to the master branch that would hopefully fix the constant use of polling on Mac. Could you guys try it out and tell me if the fix works for you?

As for double change issue, I couldn't reproduce it. Are you seeing this issue while using Guard or do you use Listen in your own project? if so, could someone post a repeatable way to reproduce that issue?

@jeremyruppel
Copy link

Rock on, master seems to fix the polling issue for me. 👍 FWIW, I also have not been able to repro the double change issue.

@cmer
Copy link

cmer commented Sep 11, 2012

+1

@mattgreen
Copy link

The changes on master fixed the polling issues over here!

@brief
Copy link
Author

brief commented Sep 11, 2012

Splendid, that fixes it here as well. Thank you!

Now that that works, I can confirm that double change appears to be a polling issue. I use Listen for my own project, without Guard.

@meeech
Copy link

meeech commented Sep 12, 2012

@Maher4Ever I tried https://gist.github.com/3703306 with new changes on master. I can confirm I still get the double change firing.
osx: 10.6.8
ruby: 1.8.7

let me know if there's any other details I can report (or tests I can run) to help narrow this down.

@thibaudgg
Copy link
Member

@meeech @Maher4Ever

I wasn't able to reproduce the double change firing with your gist on:

OS X: 10.8.1
ruby 1.9.3

@meeech
Copy link

meeech commented Sep 14, 2012

@thibaudgg Is there any sort of logging I can do to help figure out whats causing this double change fire when its in polling mode?

@thibaudgg
Copy link
Member

@meeech sadly not yet.
@Maher4Ever do you have an idea how to track that?

@meeech
Copy link

meeech commented Sep 14, 2012

@Maher4Ever @thibaudgg some more details to share - maybe this will help track it down or reproduce
(tried these steps using both nano & textmate)
I open the file, and make an edit, then writeout/save - event fires 2x
I open the file, make an edit, manually undo the edit (ie: add a space, then delete the space) so the file is exactly the same as last time it was saved, then writeout/save and the event only fires the 1 time.

Is it possible in polling there's something cheking file mtime AND some sort of hash of the file itself to see if it changed? so when just the mtime has changed, the event fires 1 time, but when the actual contents of file has changed, we end up with the event firing 2x

@mraaroncruz
Copy link
Member

I was also having polling and double issues and adding gem 'listen', git: "git://github.com/guard/listen.git" to my Gemfile did fix this for me. Using guard-spork, guard-rspec and rails -v 3.2.3.
guard-spork and guard-rspec and guard were bundle updated to today.

@thibaudgg
Copy link
Member

@meeech do you also use the master branch of Listen?

@meeech
Copy link

meeech commented Sep 18, 2012

yes I was.

Sent from my iPhone

On 2012-09-18, at 10:31 AM, Thibaud Guillaume-Gentil notifications@github.com wrote:

@meeech do you also use the master branch of Listen?


Reply to this email directly or view it on GitHub.

@Maher4Ever
Copy link
Contributor

@meeech Are you experiencing the double change issue when making an edit a file via a particular editor (ex. vim or sublime) or even when running something like touch THE_FILE? It's unfortunate that I have limited time these days, but If you could narrow it down I might be able to fix it.

As for your suggestion to help fix the bug, you might be test that theory by adding some puts statements in the source code. We definitely need to add some logging functionality into Listen.

@brief
Copy link
Author

brief commented Sep 18, 2012

Since I am encountering the same issue as @meeech, here are a few more details from me.

Using his gist, touch THE_FILE results in a single change. Likewise, opening the file in a text editor and saving without any edits results in one change.

The issue only occurs when modifying a file. Editing and saving a file outputs two changes. Saving again without further modification results in one change. Making any other edits (including undo) and saving results in two changes. Effectively:

  • save: one change
  • edit and save: two changes

Tested with TextMate, Sublime Text, TextWrangler and TextEdit -- the editor does not seem to matter.

@nilbus
Copy link
Contributor

nilbus commented Sep 18, 2012

I see the behavior @meeech and @brief described in 0.5.0 whenever it uses polling, but not when it doesn't have to fall back to polling. In 0.5.1/HEAD, it's the same. With the fsevent issue fixed, I don't get the double-run error unless I start with growl -p to force polling.

I'm on OSX 10.6.8, and tested with both Ruby 1.8.7 and 1.9.3.

@meeech
Copy link

meeech commented Sep 19, 2012

@Maher4Ever @brief gave a much better summary of the issue.

@thibaudgg
Copy link
Member

@brief Thanks for the details, I was able to reproduce this issue. I'll try to create a spec to catch it.

@thibaudgg
Copy link
Member

I think I have found the issue, I'll push a fix this week.

@meeech
Copy link

meeech commented Sep 20, 2012

@thibaudgg great! thanks

@thibaudgg
Copy link
Member

This should have been fixed in the polling/double branch. Please can you give it a try by adding that in your Gemfile:

gem 'listen', github: 'guard/listen', branch: 'polling/double'

Thanks!

@meeech
Copy link

meeech commented Sep 23, 2012

@thibaudgg we have a winner! all good now over here - osx 10.6.8/ruby 1.8.7

@thibaudgg
Copy link
Member

@meeech Nice, thanks for the feedback.

0.5.2 released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests