{"action":"created","issue":{"url":"https://api.github.com/repos/real-logic/Agrona/issues/83","repository_url":"https://api.github.com/repos/real-logic/Agrona","labels_url":"https://api.github.com/repos/real-logic/Agrona/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/real-logic/Agrona/issues/83/comments","events_url":"https://api.github.com/repos/real-logic/Agrona/issues/83/events","html_url":"https://github.com/real-logic/Agrona/issues/83","id":193854358,"number":83,"title":"SIGINT doesn't work under some conditions.","user":{"login":"guidomedina","id":1789197,"avatar_url":"https://avatars.githubusercontent.com/u/1789197?v=3","gravatar_id":"","url":"https://api.github.com/users/guidomedina","html_url":"https://github.com/guidomedina","followers_url":"https://api.github.com/users/guidomedina/followers","following_url":"https://api.github.com/users/guidomedina/following{/other_user}","gists_url":"https://api.github.com/users/guidomedina/gists{/gist_id}","starred_url":"https://api.github.com/users/guidomedina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guidomedina/subscriptions","organizations_url":"https://api.github.com/users/guidomedina/orgs","repos_url":"https://api.github.com/users/guidomedina/repos","events_url":"https://api.github.com/users/guidomedina/events{/privacy}","received_events_url":"https://api.github.com/users/guidomedina/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-12-06T18:53:57Z","updated_at":"2016-12-09T11:05:50Z","closed_at":null,"body":"if I do:\r\n\r\n`kill -INT $PID`\r\n\r\nit doesn't work under Debian 8 or Ubuntu 16.04, now; with the following:\r\n\r\n```\r\nimport sun.misc.Signal;\r\nimport sun.misc.SignalHandler;\r\n\r\nimport java.util.concurrent.CountDownLatch;\r\n\r\npublic class SignalBarrier {\r\n\r\n  private final CountDownLatch latch = new CountDownLatch(1);\r\n\r\n  public SignalBarrier() {\r\n    final SignalHandler handler = (signal) -> signal();\r\n    Signal.handle(new Signal(\"INT\"), handler);\r\n    Signal.handle(new Signal(\"TERM\"), handler);\r\n  }\r\n\r\n  public void signal() {\r\n    latch.countDown();\r\n  }\r\n\r\n  public void await() {\r\n    try {\r\n      latch.await();\r\n    } catch (final InterruptedException ignore) {\r\n      Thread.currentThread().interrupt();\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nwhen I do:\r\n\r\n`kill -TERM $PID` or `kill $PID`\r\n\r\nit works, the main reason for me using a `SIGTERM` or `SIGINT` is because `Aeron` has a shutdown hook making the node leaving an `Akka cluster` not leave correctly, the only method to shutdown properly now is by using a signal.\r\n\r\nThis was the best that I could come up with that seems to work."},"comment":{"url":"https://api.github.com/repos/real-logic/Agrona/issues/comments/265989087","html_url":"https://github.com/real-logic/Agrona/issues/83#issuecomment-265989087","issue_url":"https://api.github.com/repos/real-logic/Agrona/issues/83","id":265989087,"user":{"login":"guidomedina","id":1789197,"avatar_url":"https://avatars.githubusercontent.com/u/1789197?v=3","gravatar_id":"","url":"https://api.github.com/users/guidomedina","html_url":"https://github.com/guidomedina","followers_url":"https://api.github.com/users/guidomedina/followers","following_url":"https://api.github.com/users/guidomedina/following{/other_user}","gists_url":"https://api.github.com/users/guidomedina/gists{/gist_id}","starred_url":"https://api.github.com/users/guidomedina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guidomedina/subscriptions","organizations_url":"https://api.github.com/users/guidomedina/orgs","repos_url":"https://api.github.com/users/guidomedina/repos","events_url":"https://api.github.com/users/guidomedina/events{/privacy}","received_events_url":"https://api.github.com/users/guidomedina/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T11:05:50Z","updated_at":"2016-12-09T11:05:50Z","body":"I think yes such scenario will be nice, I think Akka guys are trying to work around the shutdown issue so maybe they need to be aware of it, it gets more complicated for Akka Sharding and other components that ned an orderly shutdown.\r\n\r\nWDYT @patriknw"}}
{"actor":{"display_login":"guidomedina"}}