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

sync crashing on nofile #57

Open
mattiasw2 opened this issue May 8, 2015 · 6 comments
Open

sync crashing on nofile #57

mattiasw2 opened this issue May 8, 2015 · 6 comments

Comments

@mattiasw2
Copy link

Really like sync. I am also using EDTS for Emacs, and I think there are some strange interactions.

The core issue is

sync_scanner:start_link() at <0.163.0> exit with reason no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in context child_terminated

i.e. the beam file is missing. Most likely, it is recompiled by "someone else".

I tried making a simple patch to wait 1000ms and retry, but didn't solve. it.

Most often, the failure is recovered, but sometimes, it takes the erlang down, as seen below.

([email protected])1> Scanning source files...
([email protected])1> 10:45:29.797 [error] gen_server sync_scanner terminated with reason: no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500
([email protected])1> 10:45:29.797 [error] CRASH REPORT Process sync_scanner with 0 neighbours exited with reason: no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in gen_server:terminate/7 line 804
([email protected])1> 10:45:29.798 [error] Supervisor sync had child sync_scanner started with sync_scanner:start_link() at <0.163.0> exit with reason no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in context child_terminated
([email protected])1> Scanning source files...
([email protected])1> 10:45:30.163 [error] gen_server sync_scanner terminated with reason: no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500
([email protected])1> 10:45:30.164 [error] CRASH REPORT Process sync_scanner with 0 neighbours exited with reason: no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in gen_server:terminate/7 line 804
([email protected])1> 10:45:30.164 [error] Supervisor sync had child sync_scanner started with sync_scanner:start_link() at <0.1657.0> exit with reason no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in context child_terminated
([email protected])1> Scanning source files...
([email protected])1> 10:45:30.501 [error] gen_server sync_scanner terminated with reason: no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500
([email protected])1> 10:45:30.501 [error] CRASH REPORT Process sync_scanner with 0 neighbours exited with reason: no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in gen_server:terminate/7 line 804
([email protected])1> 10:45:30.502 [error] Supervisor sync had child sync_scanner started with sync_scanner:start_link() at <0.1668.0> exit with reason no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in context child_terminated
([email protected])1> Scanning source files...
([email protected])1> 10:45:30.835 [error] gen_server sync_scanner terminated with reason: no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500
([email protected])1> 10:45:30.835 [error] CRASH REPORT Process sync_scanner with 0 neighbours exited with reason: no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in gen_server:terminate/7 line 804
([email protected])1> 10:45:30.835 [error] Supervisor sync had child sync_scanner started with sync_scanner:start_link() at <0.1679.0> exit with reason no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in context child_terminated
([email protected])1> Scanning source files...
([email protected])1> 10:45:31.330 [error] gen_server sync_scanner terminated with reason: no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500
([email protected])1> 10:45:31.338 [error] CRASH REPORT Process sync_scanner with 0 neighbours exited with reason: no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in gen_server:terminate/7 line 804
([email protected])1> 10:45:31.338 [error] Supervisor sync had child sync_scanner started with sync_scanner:start_link() at <0.1692.0> exit with reason no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in context child_terminated
([email protected])1> 10:45:31.965 [error] gen_server sync_scanner terminated with reason: no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500
([email protected])1> 10:45:31.967 [error] CRASH REPORT Process sync_scanner with 0 neighbours exited with reason: no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in gen_server:terminate/7 line 804
([email protected])1> 10:45:31.968 [error] Supervisor sync had child sync_scanner started with sync_scanner:start_link() at <0.1703.0> exit with reason no case clause matching {error,nofile} in sync_scanner:reload_if_necessary/7 line 500 in context child_terminated
([email protected])1> 10:45:31.969 [error] Supervisor sync had child sync_scanner started with sync_scanner:start_link() at <0.1703.0> exit with reason reached_max_restart_intensity in context shutdown
([email protected])1> 10:45:31.969 [info] Application sync exited with reason: shutdown
([email protected])1> 10:45:31.969 [error] Supervisor share3_sup had child share3 started with share3:start() at <0.156.0> exit with reason noproc in context shutdown_error
([email protected])1> 
=INFO REPORT==== 8-May-2015::10:45:32 ===
stop_ready([], <0.173.0>)
([email protected])1> 
=INFO REPORT==== 8-May-2015::10:45:32 ===
stop_ready([{{1431,74730,66399},<0.175.0>}], <0.440.0>)
([email protected])1> {"Kernel pid terminated",application_controller,"{application_terminated,sync,shutdown}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_terminated,sync,shutdown})
mattias@ubuntu:~$ 
@s1eepwalker
Copy link

same error
Ubutnu 14.04 x64
erlang:system_info(version).
"6.2"
erlang:system_info(otp_release).
"17"

@choptastic
Copy link
Collaborator

Interesting, thanks for posting this. It's definitely not something I've experienced (though I don't use Emacs).

I think I see what's going on here, but as I'm not experiencing this, it might be tough to reproduce, but at the very least, I've noticed one problem with the code, so I can start there, and if that doesn't fix it, I can install emacs and EDTS to see what I'm able to uncover.

Thanks again for the report and the confirmation.

@mattiasw2
Copy link
Author

Just an idea: It might also the symlinks created by "relx -d" that is the problem.

@boozelclark
Copy link

I am having the same issue and using sync with rebar3 so also using relx.
Ubuntu 15.04 with erts 6-4

@choptastic
Copy link
Collaborator

Thanks for all the confirmation, guys. I haven't yet had a chance to do much open-source work these past few months (I've been in a bit of a crunch mode), but as soon as my schedule clears up a bit, I'll be able to put out a fix for this.

The immediate hacky fix would be to add another error clause to https://github.com/rustyio/sync/blob/master/src/sync_scanner.erl#L500 and see if that solves the problem. I'm not entirely sure what the correct approach should be to handle if it returns {error, nofile} like it's doing, but my suspicion would be to just generate a warning and see how prevalent the problem is.

That said, I've noticed that https://github.com/rustyio/sync/blob/master/src/sync_scanner.erl#L498 and https://github.com/rustyio/sync/blob/master/src/sync_scanner.erl#L524 are being called redundantly, which seems to be a problem, but probably unrelated to this particular error.

@mattiasw2
Copy link
Author

In my case, it happens for Yaws compilation of files. I have not fixed it, it just tells me when it fails. I use embedded yaws.

mattiasw2@75ef609

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

4 participants