{"action":"created","issue":{"url":"https://api.github.com/repos/tarantool/go-tarantool/issues/20","repository_url":"https://api.github.com/repos/tarantool/go-tarantool","labels_url":"https://api.github.com/repos/tarantool/go-tarantool/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/tarantool/go-tarantool/issues/20/comments","events_url":"https://api.github.com/repos/tarantool/go-tarantool/issues/20/events","html_url":"https://github.com/tarantool/go-tarantool/issues/20","id":166312950,"number":20,"title":"Reconnect options, working?","user":{"login":"kmansoft","id":1686219,"avatar_url":"https://avatars.githubusercontent.com/u/1686219?v=3","gravatar_id":"","url":"https://api.github.com/users/kmansoft","html_url":"https://github.com/kmansoft","followers_url":"https://api.github.com/users/kmansoft/followers","following_url":"https://api.github.com/users/kmansoft/following{/other_user}","gists_url":"https://api.github.com/users/kmansoft/gists{/gist_id}","starred_url":"https://api.github.com/users/kmansoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmansoft/subscriptions","organizations_url":"https://api.github.com/users/kmansoft/orgs","repos_url":"https://api.github.com/users/kmansoft/repos","events_url":"https://api.github.com/users/kmansoft/events{/privacy}","received_events_url":"https://api.github.com/users/kmansoft/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-19T11:54:55Z","updated_at":"2016-07-19T12:23:08Z","closed_at":null,"body":"Not sure if this is a bug or my misunderstanding...\r\n\r\nI'm running a test app with these options, artificial values to make the point:\r\n\r\n```go\r\n    opts := tarantool.Opts{\r\n\t\tTimeout:       500 * time.Millisecond,\r\n\t\tReconnect:     100 * time.Second,\r\n\t\tMaxReconnects: 300000,\r\n    }\r\n```\r\n\r\nIf I shutdown or SIGKILL the tarantool side of things, and quickly restart (within maybe 1 second, the time it takes me to \"arrow up\" + \"enter\") -- then I expect the client to reconnect and keep going.\r\n\r\nInstead, my client gets an error from the Tarantool bindings, like this:\r\n\r\n```\r\n\t\t_, err := client.Call(\"push_ChangeSub\", []interface{}{sub_id, dev_id, now})\r\n\t\tif err != nil {\r\n\t\t\tlog.Fatalf(\"Error calling function: %s\", err.Error())\r\n\t\t}\r\n```\r\nActual message, happens immediately after I shutdown / kill tarantool:\r\n```\r\nError calling function: EOF\r\n```\r\n\r\nAm I misunderstanding what the reconnect options do?\r\n\r\nIs there good way to add basic fault tolerance / reconnect?\r\n\r\nShould I be calling client.Ping() before every request (seems expensive)?\r\n"},"comment":{"url":"https://api.github.com/repos/tarantool/go-tarantool/issues/comments/233615582","html_url":"https://github.com/tarantool/go-tarantool/issues/20#issuecomment-233615582","issue_url":"https://api.github.com/repos/tarantool/go-tarantool/issues/20","id":233615582,"user":{"login":"mialinx","id":210543,"avatar_url":"https://avatars.githubusercontent.com/u/210543?v=3","gravatar_id":"","url":"https://api.github.com/users/mialinx","html_url":"https://github.com/mialinx","followers_url":"https://api.github.com/users/mialinx/followers","following_url":"https://api.github.com/users/mialinx/following{/other_user}","gists_url":"https://api.github.com/users/mialinx/gists{/gist_id}","starred_url":"https://api.github.com/users/mialinx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mialinx/subscriptions","organizations_url":"https://api.github.com/users/mialinx/orgs","repos_url":"https://api.github.com/users/mialinx/repos","events_url":"https://api.github.com/users/mialinx/events{/privacy}","received_events_url":"https://api.github.com/users/mialinx/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T12:23:08Z","updated_at":"2016-07-19T12:23:08Z","body":"It supposed to reestablish connection after tarantool restarts.\r\nYou don't need to connect manually (eg. call tarantool.Connect) each time.\r\nBut all request issued during tarantool restart will be failed, because restart may take minutes and we can't queue them inside the driver.\r\n\r\nYou have two options:\r\n* just log an error and continue running (use log.Printf instead of log.Fatalf)\r\n* try to defer failed request and run them later\r\n\r\n"}}
{"actor":{"display_login":"mialinx"}}