{"action":"opened","issue":{"url":"https://api.github.com/repos/rails/rails/issues/26538","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/26538/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/26538/comments","events_url":"https://api.github.com/repos/rails/rails/issues/26538/events","html_url":"https://github.com/rails/rails/issues/26538","id":177658257,"number":26538,"title":"ActionCable test passes on Travis but fails locally","user":{"login":"rafamanzo","id":288884,"avatar_url":"https://avatars.githubusercontent.com/u/288884?v=3","gravatar_id":"","url":"https://api.github.com/users/rafamanzo","html_url":"https://github.com/rafamanzo","followers_url":"https://api.github.com/users/rafamanzo/followers","following_url":"https://api.github.com/users/rafamanzo/following{/other_user}","gists_url":"https://api.github.com/users/rafamanzo/gists{/gist_id}","starred_url":"https://api.github.com/users/rafamanzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafamanzo/subscriptions","organizations_url":"https://api.github.com/users/rafamanzo/orgs","repos_url":"https://api.github.com/users/rafamanzo/repos","events_url":"https://api.github.com/users/rafamanzo/events{/privacy}","received_events_url":"https://api.github.com/users/rafamanzo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-18T15:30:27Z","updated_at":"2016-09-18T15:30:27Z","closed_at":null,"body":"### Steps to reproduce\r\n\r\nRun ActionCable test `env FAYE=1 bundle exec ruby -Itest test/client_test.rb -n test_server_restart`\r\n\r\n### Expected behavior\r\n\r\nThe test should pass.\r\n\r\n### Actual behavior\r\n\r\nRaises a [segmentation fault](https://gist.github.com/rafamanzo/c7a23b7b6f89ec4b0cfe9da27297d477).\r\n\r\n### System configuration\r\n**Rails version**: git at 2c5cb411b5755f3cfac7413b1c18e7d65acc208d\r\n\r\n**Ruby version**: 2.3.1\r\n\r\nI've first experienced this on Arch Linux. Then tried within a Ubuntu 16.04 vagrant box with the same error. Finally after noticing it [do pass on travis](https://travis-ci.org/rails/rails/jobs/156664411), I've tried within a Ubuntu 12.04 vagrant box and surprise! It passes! So this looks like something that can possibly blow up when users update their servers.\r\n\r\nI've been on this for a few weeks trying to debug/fix with no success. Here is what I've got so far:\r\n\r\n* Looks like an instance of an already known EventMachine issue (https://github.com/eventmachine/eventmachine/issues/670)\r\n* The stack trace is not so helpful on finding the source. So I've scattered prints across the code in order to get more information:\r\n  - The call to `ActionCable.server.restart` is the last successful one\r\n  - After that a call to `SyncClient#on(:close)` is done and the segfault comes up\r\n* I've tried to protect the `EventMachine` usage with a mutex such as `ActionCable::Connection::FayeEventLoop#ensure_reactor_running` but the error persists\r\n\r\nI've come to a workaround for which I'll open a PR following, but I'd like to ask for AC experienced eyes to have a look if this is not a symptom of something worse, since AC calls `EventMachine#run` at several places which might cause the same segfault on server restarts (since no user has complained about this yet looks unlikely to be happening)."}}
{"actor":{"display_login":"rafamanzo"}}