{"action":"opened","issue":{"url":"https://api.github.com/repos/stve/em-logger/issues/2","repository_url":"https://api.github.com/repos/stve/em-logger","labels_url":"https://api.github.com/repos/stve/em-logger/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/stve/em-logger/issues/2/comments","events_url":"https://api.github.com/repos/stve/em-logger/issues/2/events","html_url":"https://github.com/stve/em-logger/issues/2","id":297695692,"number":2,"title":"eventmachine not initialized: evma_signal_loopbreak","user":{"login":"abrom","id":3761400,"avatar_url":"https://avatars0.githubusercontent.com/u/3761400?v=4","gravatar_id":"","url":"https://api.github.com/users/abrom","html_url":"https://github.com/abrom","followers_url":"https://api.github.com/users/abrom/followers","following_url":"https://api.github.com/users/abrom/following{/other_user}","gists_url":"https://api.github.com/users/abrom/gists{/gist_id}","starred_url":"https://api.github.com/users/abrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrom/subscriptions","organizations_url":"https://api.github.com/users/abrom/orgs","repos_url":"https://api.github.com/users/abrom/repos","events_url":"https://api.github.com/users/abrom/events{/privacy}","received_events_url":"https://api.github.com/users/abrom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-16T06:52:09Z","updated_at":"2018-02-16T06:52:09Z","closed_at":null,"author_association":"NONE","body":"Hi @stve,\r\n\r\nI've recently downscaled the boxes I have EM running on and noticed the above runtime error coming out of EM on boot. I believe it's related to `em-logger`, in particular to initialisation timing. \r\n\r\nHere is the stack trace:\r\n\r\n```\r\n/gems/eventmachine-1.2.5/lib/eventmachine.rb:1133 in signal_loopbreak\r\n/gems/eventmachine-1.2.5/lib/eventmachine.rb:1133 in next_tick\r\n/gems/eventmachine-1.2.5/lib/eventmachine.rb:237 in schedule\r\n/gems/eventmachine-1.2.5/lib/em/queue.rb:32 in pop\r\n/gems/em-logger-0.1.0/lib/em-logger/logger.rb:26 in block (2 levels) in initialize\r\n/gems/eventmachine-1.2.5/lib/eventmachine.rb:1076 in block in spawn_threadpool\r\n```\r\n\r\nAs far as I can tell the issue comes from the logger being initialised before the EM reactor has started; when first running through the `queue_processor` loop it's falling over. No doubt the speed/memory etc of the underlying system will effect how the timing of the defer threading etc are handled.\r\n\r\nWould there be any reason one wouldn't want to initialise the logger within the EM run block? \r\n\r\nI've tested this out and there don't appear to be any side effects.\r\n\r\nHappy to push a README update PR to that point:\r\n\r\n```\r\nrequire 'eventmachine'\r\nrequire 'logger'\r\nrequire 'em-logger'\r\n\r\nlog = Logger.new(STDOUT)\r\n\r\nEM.run do\r\n  logger = EM::Logger.new(log)\r\n  logger.info('ohai')\r\n\r\n  EM.stop\r\nend\r\n```"}}
{"actor":{"display_login":"abrom"}}