{"action":"created","issue":{"url":"https://api.github.com/repos/apache/cloudstack/issues/2638","repository_url":"https://api.github.com/repos/apache/cloudstack","labels_url":"https://api.github.com/repos/apache/cloudstack/issues/2638/labels{/name}","comments_url":"https://api.github.com/repos/apache/cloudstack/issues/2638/comments","events_url":"https://api.github.com/repos/apache/cloudstack/issues/2638/events","html_url":"https://github.com/apache/cloudstack/pull/2638","id":322251540,"number":2638,"title":"agent: Fixes #2633 don't wait for pending tasks on reconnection","user":{"login":"rhtyd","id":95203,"avatar_url":"https://avatars0.githubusercontent.com/u/95203?v=4","gravatar_id":"","url":"https://api.github.com/users/rhtyd","html_url":"https://github.com/rhtyd","followers_url":"https://api.github.com/users/rhtyd/followers","following_url":"https://api.github.com/users/rhtyd/following{/other_user}","gists_url":"https://api.github.com/users/rhtyd/gists{/gist_id}","starred_url":"https://api.github.com/users/rhtyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhtyd/subscriptions","organizations_url":"https://api.github.com/users/rhtyd/orgs","repos_url":"https://api.github.com/users/rhtyd/repos","events_url":"https://api.github.com/users/rhtyd/events{/privacy}","received_events_url":"https://api.github.com/users/rhtyd/received_events","type":"User","site_admin":false},"labels":[{"id":584072971,"url":"https://api.github.com/repos/apache/cloudstack/labels/kvm","name":"kvm","color":"006b75","default":false},{"id":584073449,"url":"https://api.github.com/repos/apache/cloudstack/labels/ssvm","name":"ssvm","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":{"login":"rhtyd","id":95203,"avatar_url":"https://avatars0.githubusercontent.com/u/95203?v=4","gravatar_id":"","url":"https://api.github.com/users/rhtyd","html_url":"https://github.com/rhtyd","followers_url":"https://api.github.com/users/rhtyd/followers","following_url":"https://api.github.com/users/rhtyd/following{/other_user}","gists_url":"https://api.github.com/users/rhtyd/gists{/gist_id}","starred_url":"https://api.github.com/users/rhtyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhtyd/subscriptions","organizations_url":"https://api.github.com/users/rhtyd/orgs","repos_url":"https://api.github.com/users/rhtyd/repos","events_url":"https://api.github.com/users/rhtyd/events{/privacy}","received_events_url":"https://api.github.com/users/rhtyd/received_events","type":"User","site_admin":false},"assignees":[{"login":"rhtyd","id":95203,"avatar_url":"https://avatars0.githubusercontent.com/u/95203?v=4","gravatar_id":"","url":"https://api.github.com/users/rhtyd","html_url":"https://github.com/rhtyd","followers_url":"https://api.github.com/users/rhtyd/followers","following_url":"https://api.github.com/users/rhtyd/following{/other_user}","gists_url":"https://api.github.com/users/rhtyd/gists{/gist_id}","starred_url":"https://api.github.com/users/rhtyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhtyd/subscriptions","organizations_url":"https://api.github.com/users/rhtyd/orgs","repos_url":"https://api.github.com/users/rhtyd/repos","events_url":"https://api.github.com/users/rhtyd/events{/privacy}","received_events_url":"https://api.github.com/users/rhtyd/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/apache/cloudstack/milestones/5","html_url":"https://github.com/apache/cloudstack/milestone/5","labels_url":"https://api.github.com/repos/apache/cloudstack/milestones/5/labels","id":3033298,"number":5,"title":"4.11.1.0","description":"Milestone covering PRs for the next 4.11.1.0 release. All PRs using this milestone should send PR against the 4.11 branch.","creator":{"login":"DaanHoogland","id":2486961,"avatar_url":"https://avatars1.githubusercontent.com/u/2486961?v=4","gravatar_id":"","url":"https://api.github.com/users/DaanHoogland","html_url":"https://github.com/DaanHoogland","followers_url":"https://api.github.com/users/DaanHoogland/followers","following_url":"https://api.github.com/users/DaanHoogland/following{/other_user}","gists_url":"https://api.github.com/users/DaanHoogland/gists{/gist_id}","starred_url":"https://api.github.com/users/DaanHoogland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaanHoogland/subscriptions","organizations_url":"https://api.github.com/users/DaanHoogland/orgs","repos_url":"https://api.github.com/users/DaanHoogland/repos","events_url":"https://api.github.com/users/DaanHoogland/events{/privacy}","received_events_url":"https://api.github.com/users/DaanHoogland/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":95,"state":"open","created_at":"2018-01-13T20:06:17Z","updated_at":"2018-05-11T16:47:26Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2018-05-11T10:41:49Z","updated_at":"2018-05-14T07:03:16Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/2638","html_url":"https://github.com/apache/cloudstack/pull/2638","diff_url":"https://github.com/apache/cloudstack/pull/2638.diff","patch_url":"https://github.com/apache/cloudstack/pull/2638.patch"},"body":"When agent loses connection with management server, the reconnection\r\nlogic waits for any pending tasks to finish. However, when such tasks\r\ndo finish they fail to send an `Answer` back to managements server.\r\nTherefore from a management server's perspective such pending\r\noperations are stuck in a FSM state and need manual removal or fixing.\r\nThis is by design where management server's side cmd-answer request\r\npattern is code/execution dependent, therefore even if the answer\r\nwere to be sent when management server came back up (reconnects)\r\nthe management server will fail to acknowledge and process the answer\r\ndue to missing listeners or being in the exact state to handle answers.\r\n\r\nHistorically, the Agent would wait to reconnect until the internal\r\ntasks complete but I found no reason why it should wait for reconnection\r\nat all.\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n- [ ] New feature (non-breaking change which adds functionality)\r\n- [x] Bug fix (non-breaking change which fixes an issue)\r\n- [ ] Enhancement (improves an existing feature and functionality)\r\n- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)\r\n\r\n## GitHub Issue/PRs\r\n<!-- If this PR is to fix an issue or another PR on GH, uncomment the section and provide the id of issue/PR -->\r\n<!-- When \"Fixes: #<id>\" is specified, the issue/PR will automatically be closed when this PR gets merged -->\r\n<!-- For addressing multiple issues/PRs, use multiple \"Fixes: #<id>\" -->\r\n\r\n<!-- Fixes: # -->\r\n\r\n## Screenshots (if appropriate):\r\n\r\n## How Has This Been Tested?\r\n\r\nBefore fix: Started a snapshot of a volume, killed/shutdown the management server to see that agent is blocked until the job finished. When the job finishes, it fails to send answer. When mgmt server is started again, it has the snapshot still in backing state. However, the agent is blocked until the job finishes, even if the mgmt server were to come up online. Irrespective of the case, the pending job fails to reply (as the link object changes, the `send` fails).\r\n\r\nAfter fix: The same as above, but this time agent is not blocked by any long-running pending job and reconnects faster. The failure scenarios remain the same, including manual fixing (if any) needed after the mgmt server is back.\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] I have read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document.\r\n- [x] My code follows the code style of this project.\r\n- [ ] My change requires a change to the documentation.\r\n- [ ] I have updated the documentation accordingly.\r\nTesting\r\n- [ ] I have added tests to cover my changes.\r\n- [ ] All relevant new and existing integration tests have passed.\r\n- [ ] A full integration testsuite with all test that can run on my environment has passed.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apache/cloudstack/issues/comments/388716593","html_url":"https://github.com/apache/cloudstack/pull/2638#issuecomment-388716593","issue_url":"https://api.github.com/repos/apache/cloudstack/issues/2638","id":388716593,"user":{"login":"borisstoyanov","id":13551960,"avatar_url":"https://avatars1.githubusercontent.com/u/13551960?v=4","gravatar_id":"","url":"https://api.github.com/users/borisstoyanov","html_url":"https://github.com/borisstoyanov","followers_url":"https://api.github.com/users/borisstoyanov/followers","following_url":"https://api.github.com/users/borisstoyanov/following{/other_user}","gists_url":"https://api.github.com/users/borisstoyanov/gists{/gist_id}","starred_url":"https://api.github.com/users/borisstoyanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borisstoyanov/subscriptions","organizations_url":"https://api.github.com/users/borisstoyanov/orgs","repos_url":"https://api.github.com/users/borisstoyanov/repos","events_url":"https://api.github.com/users/borisstoyanov/events{/privacy}","received_events_url":"https://api.github.com/users/borisstoyanov/received_events","type":"User","site_admin":false},"created_at":"2018-05-14T07:03:16Z","updated_at":"2018-05-14T07:03:16Z","author_association":"CONTRIBUTOR","body":"@blueorangutan package"}}
{"actor":{"display_login":"borisstoyanov"}}