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

fsevents event type missing #204

Open
splunchy opened this issue May 7, 2013 · 10 comments
Open

fsevents event type missing #204

splunchy opened this issue May 7, 2013 · 10 comments

Comments

@splunchy
Copy link

splunchy commented May 7, 2013

Hi all.

----- What's happening? -----

I figured out that there is a fsevent type missing in the switch statements in fsevents.c in handle_event(...), namely FSE_EXCHANGE.

----- When does it happen? -----
I'm using TextMate 2 in Mac OSX 10.8.3, and this editor triggers the event of type FSE_EXCHANGE (instead of FSE_CONTENT_MODIFIED) when a file is saved.
I tried also other text editors (vi, emacs, TextMate 1.x, Sublime) and only TM2 shows the described behaviour.

----- Further information -----
I attached some output of an fslogger application. It shows that the triggered event contains the two exchanged files and the time stamp.

Afterwards, an event of type FSE_XATTR_MODIFIED is fired.
So one could also add FSE_XATTR_MODIFIED and FSE_XATTR_REMOVED

See definitions in http://www.opensource.apple.com/source/xnu/xnu-2050.22.13/bsd/sys/fsevents.h

Thanks a lot for this great open source app :))

Fabian


From fslogger:

# Event
  type           = FSE_EXCHANGE
  pid            = 31133 (TextMate)
  # Details
    # type           len  data
    FSE_ARG_STRING    85  string = vate/var/folders/4_/pbz8rz515zd3wbw6vfvmdqpm0000gp/T/TextMate_atomic_save.AFbMzm
    FSE_ARG_DEV        4  dev    = 0x040007 (major 0, minor 262151)
    FSE_ARG_INO        4  ino    = 262154
    FSE_ARG_MODE       4  mode   = ?-----x---  (0x040008, vnode type VNON)
    FSE_ARG_UID        4  uid    = 262155 (?)
    FSE_ARG_GID        4  gid    = 1703938 (?)
    FSE_ARG_STRING    26  string = rs/fabian/bla/asd.txt
    FSE_ARG_DEV        4  dev    = 0x040007 (major 0, minor 262151)
    FSE_ARG_INO        4  ino    = 262154
    FSE_ARG_MODE       4  mode   = ?-----x---  (0x040008, vnode type VNON)
    FSE_ARG_UID        4  uid    = 262155 (?)
    FSE_ARG_GID        4  gid    = 524293 (?)
    FSE_ARG_INT64      8  tstamp = 478558141073975
    FSE_ARG_DONE (0xb33f)

# Event
  type           = FSE_XATTR_MODIFIED
  pid            = 31133 (TextMate)
  # Details
    # type           len  data
    FSE_ARG_STRING    26  string = rs/fabian/bla/asd.txt
    FSE_ARG_DEV        4  dev    = 0x040007 (major 0, minor 262151)
    FSE_ARG_INO        4  ino    = 262154
    FSE_ARG_MODE       4  mode   = ?-----x---  (0x040008, vnode type VNON)
    FSE_ARG_UID        4  uid    = 262155 (?)
    FSE_ARG_GID        4  gid    = 524293 (?)
    FSE_ARG_INT64      8  tstamp = 478558141073975
    FSE_ARG_DONE (0xb33f)
@axkibe
Copy link
Collaborator

axkibe commented Jun 7, 2013

I'm going to skip this issue for 2.1.5 since this is more complicated to fix. Lsyncd does not know about a swap operation and I don't how to map this to conventional ops.

@Gerst20051
Copy link

Has this been fixed in 2.1.5?

@axkibe
Copy link
Collaborator

axkibe commented Mar 4, 2014

Sorry this has not been fixed. And as I've been convinced the OSX fsevents mechanism should get a major overhaul anyway.

@Gerst20051
Copy link

Oh Okay. @axkibe

@terranisu
Copy link

@axkibe Hi there.

Why just not ignore unknown events? What the negative consequences?https://github.com/axkibe/lsyncd/blob/master/fsevents.c#L179-L188

	} else {
		printlogf(
			L,
			"Warn",
			"unknown event(%d) in fsevents.",
			atype
		);

		return;
	}

BTW, thanks a lot for the lsyncd.

@PetrochukM
Copy link

PetrochukM commented Oct 20, 2023

Hey! This issue is coming up again, and I am not sure how to debug it. I have been trying to use fs_usage to monitor the event but to no avail. This is preventing me from using lsyncd, it crashes right after the first sync on my Macbook, every time.

Error: unknown event(831) in fsevents.

@katiabestcat
Copy link

katiabestcat commented Nov 3, 2023

I have the same issue and error message, unfortunately, Lsyncd can't run on my Mac after the first sync and I get "Error: unknown event(831) in fsevents."

@Gerst20051
Copy link

Are either of you using macOS Sonoma? Another possibility is that lsyncd is not compatible with ARM Macs 🤷 @PetrochukM @katiabestcat

@katiabestcat
Copy link

yes indeed I'm using macOS Sonoma Version 14.1 using an Apple M2 chip. If lsyncd is not compatible with ARM Macs, maybe the manual should be updated to let Mac users know...I turned to Facebook's Watchman, which seems to work for my use case

@axkibe
Copy link
Collaborator

axkibe commented Nov 6, 2023

the osx events interface of Lsyncd is generally very outdated, and as far as I know unmaintained, unless someone finds willing to do that, and best rewrite it all together to use FSEvents insted of that experiment I did back then to directly access the internal buffer, I'd advice against using it, or removing it from Lsyncd altogether.

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

6 participants