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

fix proposition for stat.st_dev unsupported (Solaris 32b) #31

Open
Aldian-fr opened this issue Apr 11, 2014 · 1 comment
Open

fix proposition for stat.st_dev unsupported (Solaris 32b) #31

Aldian-fr opened this issue Apr 11, 2014 · 1 comment

Comments

@Aldian-fr
Copy link

For reference I came here after investigating https://logstash.jira.com/browse/LOGSTASH-665

It appears that the bug comes from filewatch which can't use stat.st_dev on Solaris. But (see my comment 22253 on the bug report) after replacing occurences of stat.dev_major and stat.dev_minor by nil, the bug disappeared.

I need an indication on the safety risk of this hack since I am not used to ruby, and in case there would not be too much, I suggest you should catch the exception and use nill as a default value.

@Aldian-fr
Copy link
Author

I investigated a little more. Traditionally, the usage of dev_major & dev_minor avoid collision between two files from two different disks. But inside filewatch there is a priori no risk of collision because it seems that filewatch always refers to a file by its path. It's mostly guessing, but as far as I understand the code, filewatch uses the inode uniquely in its sincedb file for detecting a rollover, so my proposition could work...

...If there was not another issue that I detected only today: it is similar to https://logstash.jira.com/browse/LOGSTASH-429 that already have a fix been merged but only for windows. After checking every sincedb file that were written since I started experimenting, I finally noticed that the number corresponding to the inode is always 0.

Seems like a quite old bug from ruby...

Since it seems that @edwinf fixed it for windows in #22 I think that next I am going to look into it

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

1 participant