{"action":"created","issue":{"url":"https://api.github.com/repos/lagom/lagom/issues/722","repository_url":"https://api.github.com/repos/lagom/lagom","labels_url":"https://api.github.com/repos/lagom/lagom/issues/722/labels{/name}","comments_url":"https://api.github.com/repos/lagom/lagom/issues/722/comments","events_url":"https://api.github.com/repos/lagom/lagom/issues/722/events","html_url":"https://github.com/lagom/lagom/issues/722","id":226325204,"number":722,"title":"Lagom's CassandraSession won't recover on C* node failure","user":{"login":"ignasi35","id":762126,"avatar_url":"https://avatars1.githubusercontent.com/u/762126?v=3","gravatar_id":"","url":"https://api.github.com/users/ignasi35","html_url":"https://github.com/ignasi35","followers_url":"https://api.github.com/users/ignasi35/followers","following_url":"https://api.github.com/users/ignasi35/following{/other_user}","gists_url":"https://api.github.com/users/ignasi35/gists{/gist_id}","starred_url":"https://api.github.com/users/ignasi35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignasi35/subscriptions","organizations_url":"https://api.github.com/users/ignasi35/orgs","repos_url":"https://api.github.com/users/ignasi35/repos","events_url":"https://api.github.com/users/ignasi35/events{/privacy}","received_events_url":"https://api.github.com/users/ignasi35/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"ignasi35","id":762126,"avatar_url":"https://avatars1.githubusercontent.com/u/762126?v=3","gravatar_id":"","url":"https://api.github.com/users/ignasi35","html_url":"https://github.com/ignasi35","followers_url":"https://api.github.com/users/ignasi35/followers","following_url":"https://api.github.com/users/ignasi35/following{/other_user}","gists_url":"https://api.github.com/users/ignasi35/gists{/gist_id}","starred_url":"https://api.github.com/users/ignasi35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignasi35/subscriptions","organizations_url":"https://api.github.com/users/ignasi35/orgs","repos_url":"https://api.github.com/users/ignasi35/repos","events_url":"https://api.github.com/users/ignasi35/events{/privacy}","received_events_url":"https://api.github.com/users/ignasi35/received_events","type":"User","site_admin":false},"assignees":[{"login":"ignasi35","id":762126,"avatar_url":"https://avatars1.githubusercontent.com/u/762126?v=3","gravatar_id":"","url":"https://api.github.com/users/ignasi35","html_url":"https://github.com/ignasi35","followers_url":"https://api.github.com/users/ignasi35/followers","following_url":"https://api.github.com/users/ignasi35/following{/other_user}","gists_url":"https://api.github.com/users/ignasi35/gists{/gist_id}","starred_url":"https://api.github.com/users/ignasi35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignasi35/subscriptions","organizations_url":"https://api.github.com/users/ignasi35/orgs","repos_url":"https://api.github.com/users/ignasi35/repos","events_url":"https://api.github.com/users/ignasi35/events{/privacy}","received_events_url":"https://api.github.com/users/ignasi35/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2017-05-04T15:46:15Z","updated_at":"2017-05-05T14:16:20Z","closed_at":"2017-05-05T14:16:20Z","body":"### Lagom Version (1.2.x / 1.3.x / etc)\r\n\r\nReproduced in `1.3.3` and probably all previous versions affected too.\r\n\r\n### API (Scala / Java / Neither / Both)\r\n\r\nReproduced using `sbt new lagom/lagom-java.g8`. I need to retry in scala.\r\n\r\n### Steps\r\n\r\n1. create a new project using the hello seed and start it using `sbt runAll`.\r\n2. using the service locator API, check the `cas_native` URI: `curl http://localhost:8000/services/cas_native`\r\n3. invoke few commands: `curl \"http://127.0.0.1:9000/api/hello/bob1\"`, `curl \"http://127.0.0.1:9000/api/hello/bob2\"`,  `curl \"http://127.0.0.1:9000/api/hello/bob3\"`. All succeed.\r\n4. Using `jps` locate the PID of the `CassandraLauncher` process and stop it: \r\n```\r\nkill -SIGSTOP `jps | grep CassandraLauncher| awk -F\\  '{print $1}' `\r\n```\r\n5. invoke a command: `curl \"http://127.0.0.1:9000/api/hello/bob4\"` and see it fail.\r\n6. Using the service locator API remove `cas_native` from the service registry:\r\n```\r\ncurl -X DELETE  http://localhost:8000/services/cas_native\r\n```\r\n7. Using `jps` locate the PID of the `CassandraLauncher` process and restart it: \r\n```\r\nkill -SIGCONT `jps | grep CassandraLauncher| awk -F\\  '{print $1}' `\r\n```\r\n8. Check there's no info wrt `cas_native` in the service locator:\r\n```\r\n$ curl http://localhost:8000/services/cas_native\r\n{\"name\":\"NotFound\",\"detail\":\"cas_native\"}\r\n```\r\n9. invoke a command: `curl \"http://127.0.0.1:9000/api/hello/bob5\"` and see it pass.\r\n10. Using the service locator API add a new (invalid) URI for  `cas_native` on the service registry:\r\n```\r\ncurl -X PUT -d '{\"uri\":\"http://127.0.0.1:4343\", \"acls\":[]}' http://localhost:8000/services/cas_native\r\n```\r\n11. Using `jps` locate the PID of the `CassandraLauncher` process and stop it: \r\n```\r\nkill -SIGSTOP `jps | grep CassandraLauncher| awk -F\\  '{print $1}' `\r\n```\r\n12. invoke a command: `curl \"http://127.0.0.1:9000/api/hello/bob6\"` and see it fail.\r\n13. Using `jps` locate the PID of the `CassandraLauncher` process and restart it: \r\n```\r\nkill -SIGCONT `jps | grep CassandraLauncher| awk -F\\  '{print $1}' `\r\n```\r\n14. invoke a command: `curl \"http://127.0.0.1:9000/api/hello/bob7\"` and see it pass.\r\n\r\n\r\n### Expected Behavior\r\n\r\nWhile the helloService cassandra client keeps a valid session, it's OK that the helloservice works as expected even when the service locator can't resolve `cas_native`. While the helloservice still has a valid cassandra session there's no need to renew the connection (steps 1 to 9).\r\nWhen the helloservice gets a connection failure, the cassandra session should be closed and an attempt to create a new one using the info in the service locator should be made. In the steps above, that's `12.` to `14.`. Following the steps reproduced above, `14.` should fail because `12.` should have invalidated the cassandra session and `14.` should have resolved `cas_native` to `http://127.0.0.1:4343` which points to nothing.\r\n\r\n\r\n### Actual Behavior\r\n\r\nWhen cassandra becomes unreachable (`12.`) the cassandra session is maintained.\r\n\r\n\r\n\r\nThis is related to https://github.com/lagom/activator-lagom-java-chirper/issues/45#issuecomment-299208952.\r\nThis is could also be related to 763b82987d9e69318b256e482bd1e03fc954a2a0 and https://github.com/lagom/lagom/pull/718#discussion_r114713512"},"comment":{"url":"https://api.github.com/repos/lagom/lagom/issues/comments/299476473","html_url":"https://github.com/lagom/lagom/issues/722#issuecomment-299476473","issue_url":"https://api.github.com/repos/lagom/lagom/issues/722","id":299476473,"user":{"login":"ignasi35","id":762126,"avatar_url":"https://avatars1.githubusercontent.com/u/762126?v=3","gravatar_id":"","url":"https://api.github.com/users/ignasi35","html_url":"https://github.com/ignasi35","followers_url":"https://api.github.com/users/ignasi35/followers","following_url":"https://api.github.com/users/ignasi35/following{/other_user}","gists_url":"https://api.github.com/users/ignasi35/gists{/gist_id}","starred_url":"https://api.github.com/users/ignasi35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignasi35/subscriptions","organizations_url":"https://api.github.com/users/ignasi35/orgs","repos_url":"https://api.github.com/users/ignasi35/repos","events_url":"https://api.github.com/users/ignasi35/events{/privacy}","received_events_url":"https://api.github.com/users/ignasi35/received_events","type":"User","site_admin":false},"created_at":"2017-05-05T14:16:20Z","updated_at":"2017-05-05T14:16:20Z","body":"Closing.\r\n\r\nThe information in this issue is confusing, incomplete or mixes different problems. See #727, #730 and #731."}}
{"actor":{"display_login":"ignasi35"}}