{"action":"closed","issue":{"url":"https://api.github.com/repos/mercury-hpc/mercury/issues/152","repository_url":"https://api.github.com/repos/mercury-hpc/mercury","labels_url":"https://api.github.com/repos/mercury-hpc/mercury/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/mercury-hpc/mercury/issues/152/comments","events_url":"https://api.github.com/repos/mercury-hpc/mercury/issues/152/events","html_url":"https://github.com/mercury-hpc/mercury/issues/152","id":205686960,"number":152,"title":"NA CCI: Tcp transport randomly hangs","user":{"login":"soumagne","id":5613371,"avatar_url":"https://avatars.githubusercontent.com/u/5613371?v=3","gravatar_id":"","url":"https://api.github.com/users/soumagne","html_url":"https://github.com/soumagne","followers_url":"https://api.github.com/users/soumagne/followers","following_url":"https://api.github.com/users/soumagne/following{/other_user}","gists_url":"https://api.github.com/users/soumagne/gists{/gist_id}","starred_url":"https://api.github.com/users/soumagne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soumagne/subscriptions","organizations_url":"https://api.github.com/users/soumagne/orgs","repos_url":"https://api.github.com/users/soumagne/repos","events_url":"https://api.github.com/users/soumagne/events{/privacy}","received_events_url":"https://api.github.com/users/soumagne/received_events","type":"User","site_admin":false},"labels":[{"id":237563825,"url":"https://api.github.com/repos/mercury-hpc/mercury/labels/bug","name":"bug","color":"000000","default":true},{"id":237563798,"url":"https://api.github.com/repos/mercury-hpc/mercury/labels/major","name":"major","color":"fbca04","default":false},{"id":237563795,"url":"https://api.github.com/repos/mercury-hpc/mercury/labels/na","name":"na","color":"c7def8","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mercury-hpc/mercury/milestones/8","html_url":"https://github.com/mercury-hpc/mercury/milestone/8","labels_url":"https://api.github.com/repos/mercury-hpc/mercury/milestones/8/labels","id":1576694,"number":8,"title":"mercury-1.0.0","description":"### Features:\r\n * Full cancellation support","creator":{"login":"soumagne","id":5613371,"avatar_url":"https://avatars.githubusercontent.com/u/5613371?v=3","gravatar_id":"","url":"https://api.github.com/users/soumagne","html_url":"https://github.com/soumagne","followers_url":"https://api.github.com/users/soumagne/followers","following_url":"https://api.github.com/users/soumagne/following{/other_user}","gists_url":"https://api.github.com/users/soumagne/gists{/gist_id}","starred_url":"https://api.github.com/users/soumagne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soumagne/subscriptions","organizations_url":"https://api.github.com/users/soumagne/orgs","repos_url":"https://api.github.com/users/soumagne/repos","events_url":"https://api.github.com/users/soumagne/events{/privacy}","received_events_url":"https://api.github.com/users/soumagne/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":2,"state":"open","created_at":"2016-02-10T23:23:55Z","updated_at":"2017-02-07T00:49:19Z","due_on":"2017-05-15T07:00:00Z","closed_at":null},"comments":4,"created_at":"2017-02-06T19:42:12Z","updated_at":"2017-02-07T00:49:19Z","closed_at":"2017-02-07T00:49:19Z","body":"Original message from Chuck:\r\n>cci+tcp has been broken since a commit done back on 21-Nov-2016.\r\n>\r\n>Mercury uses the \"cci_get_event(e, &event)\" API to receive event \r\n>notifications from cci (e.g. events like send, recv, connect req,\r\n>connect, accept).   The first arg \"e\" is the cci endpoint structure,\r\n>and the second arg \"&event\" is a pointer where the next event \r\n>structure from cci is returned.   \r\n>\r\n>The cci library owns the returned event structure (cci malloc'd\r\n>it earlier), so when Mercury is done processing the event, Mercury\r\n>returns it to cci with the call: \"cci_return_event(event)\" ...\r\n>Internally, the cci_return_event() function just adds the event\r\n>back to a free event list for reuse (in cci+tcp this is done\r\n>in ctp_tcp_return_event() -- adding the event to the idle rx\r\n>event list using \"tcp_put_rx(rx)\").\r\n> \r\n>Unfortunately, the commit from 21-Nov-2016 (c37fa323fe in git)\r\n>added an additional call to \"tcp_put_rx(rx)\" in the cci_accept()\r\n>path, when you get a connection request.   This results in the\r\n>event structure getting added to the same list twice, breaking the\r\n>list data structure.   the sequence is:\r\n>  \r\n>    1. Mercury's na_cci_progress() calls cci_get_event() and gets \r\n>       a CCI_EVENT_CONNECT_REQUEST event structure.  This gets \r\n>       routed to Mercury's \"handle_connect_request()\" function.\r\n>    \r\n>    2. \"handle_connect_request()\" calls \"cci_accept(event, ...)\" to\r\n>       accept the request.  This maps to ctp_tcp_accept() in the \r\n>       tcp plugin.  The accept function sends a reply to the \r\n>       accept (TCP_MSG_CONN_REPLY), and then with the change in\r\n>       c37fa323fe it puts the event on the free list (idle_rx)\r\n>       with a call to tcp_put_rx(rx).\r\n>\r\n>    3. Control returns to Mercury's na_cci_progress().  As \r\n>       Mercury has completed processing on the event, it calls\r\n>       cci_return_event(event) to return the event to cci.\r\n>       This maps to ctp_tcp_return_event(event) in the tcp\r\n>       plugin.   This function then calls tcp_put_rx(rx) to\r\n>       put the event on the free list (idle_rx) --- but the\r\n>       event is already on that free list (from step 2, above), \r\n>       so the attempt to add it again breaks the list data structure \r\n>       (a tailq).\r\n>\r\n>Once the idle_rx list is damaged, cci+tcp may or may not function\r\n>well enough to continue for simple programs (e.g. like when\r\n>my test program serialized its requests).   It depends the\r\n>timing of arrivals of future requests.  I think anything beyond\r\n>simple test programs are likely to fail."}}
{"actor":{"display_login":"soumagne"}}