{"action":"created","issue":{"url":"https://api.github.com/repos/ceph/ceph-rust/issues/33","repository_url":"https://api.github.com/repos/ceph/ceph-rust","labels_url":"https://api.github.com/repos/ceph/ceph-rust/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/ceph/ceph-rust/issues/33/comments","events_url":"https://api.github.com/repos/ceph/ceph-rust/issues/33/events","html_url":"https://github.com/ceph/ceph-rust/pull/33","id":332582958,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MDMyNDI1","number":33,"title":"Use phantom data trackers to auto drop","user":{"login":"cholcombe973","id":3058195,"node_id":"MDQ6VXNlcjMwNTgxOTU=","avatar_url":"https://avatars0.githubusercontent.com/u/3058195?v=4","gravatar_id":"","url":"https://api.github.com/users/cholcombe973","html_url":"https://github.com/cholcombe973","followers_url":"https://api.github.com/users/cholcombe973/followers","following_url":"https://api.github.com/users/cholcombe973/following{/other_user}","gists_url":"https://api.github.com/users/cholcombe973/gists{/gist_id}","starred_url":"https://api.github.com/users/cholcombe973/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cholcombe973/subscriptions","organizations_url":"https://api.github.com/users/cholcombe973/orgs","repos_url":"https://api.github.com/users/cholcombe973/repos","events_url":"https://api.github.com/users/cholcombe973/events{/privacy}","received_events_url":"https://api.github.com/users/cholcombe973/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"cholcombe973","id":3058195,"node_id":"MDQ6VXNlcjMwNTgxOTU=","avatar_url":"https://avatars0.githubusercontent.com/u/3058195?v=4","gravatar_id":"","url":"https://api.github.com/users/cholcombe973","html_url":"https://github.com/cholcombe973","followers_url":"https://api.github.com/users/cholcombe973/followers","following_url":"https://api.github.com/users/cholcombe973/following{/other_user}","gists_url":"https://api.github.com/users/cholcombe973/gists{/gist_id}","starred_url":"https://api.github.com/users/cholcombe973/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cholcombe973/subscriptions","organizations_url":"https://api.github.com/users/cholcombe973/orgs","repos_url":"https://api.github.com/users/cholcombe973/repos","events_url":"https://api.github.com/users/cholcombe973/events{/privacy}","received_events_url":"https://api.github.com/users/cholcombe973/received_events","type":"User","site_admin":false},"assignees":[{"login":"cholcombe973","id":3058195,"node_id":"MDQ6VXNlcjMwNTgxOTU=","avatar_url":"https://avatars0.githubusercontent.com/u/3058195?v=4","gravatar_id":"","url":"https://api.github.com/users/cholcombe973","html_url":"https://github.com/cholcombe973","followers_url":"https://api.github.com/users/cholcombe973/followers","following_url":"https://api.github.com/users/cholcombe973/following{/other_user}","gists_url":"https://api.github.com/users/cholcombe973/gists{/gist_id}","starred_url":"https://api.github.com/users/cholcombe973/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cholcombe973/subscriptions","organizations_url":"https://api.github.com/users/cholcombe973/orgs","repos_url":"https://api.github.com/users/cholcombe973/repos","events_url":"https://api.github.com/users/cholcombe973/events{/privacy}","received_events_url":"https://api.github.com/users/cholcombe973/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-06-14T22:14:36Z","updated_at":"2018-06-19T06:01:03Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/ceph/ceph-rust/pulls/33","html_url":"https://github.com/ceph/ceph-rust/pull/33","diff_url":"https://github.com/ceph/ceph-rust/pull/33.diff","patch_url":"https://github.com/ceph/ceph-rust/pull/33.patch"},"body":"This change adds automatic closing of ceph connections where necessary.  Unfortunately it required reworking a huge amount of the library.  The most important pieces are the impl Drop sections in src/ceph.rs\r\n\r\nThe basics here are I wrapped rados_t with Rados and rados_ioctx_t with IoCtx.  I made the inner fields public because my ceph-rbd library needs to get access to those pointers.  There's probably a better way to do that? \r\n\r\nI checked that this worked with a small [rayon program](https://gist.github.com/cholcombe973/8ea370c8ca37a50be17e8a900057cf0d) that runs rbd stat in parallel.  This would consistently crash until I got the Rbd, ioctx and ceph cluster connection dropping in the right order.  \r\n\r\nIt now runs fine with 10 threads and valgrind shows it's clean:\r\n```==1423173== \r\n==1423173== HEAP SUMMARY:\r\n==1423173==     in use at exit: 0 bytes in 0 blocks\r\n==1423173==   total heap usage: 408,707 allocs, 408,707 frees, 19,222,091 bytes allocated\r\n==1423173== \r\n==1423173== All heap blocks were freed -- no leaks are possible\r\n==1423173== \r\n==1423173== For counts of detected and suppressed errors, rerun with: -v\r\n==1423173== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)\r\n```\r\n\r\nI may have messed up your ceph_client.rs and cmd.rs @ChrisMacNaughton  so take a close look at those"},"comment":{"url":"https://api.github.com/repos/ceph/ceph-rust/issues/comments/398283708","html_url":"https://github.com/ceph/ceph-rust/pull/33#issuecomment-398283708","issue_url":"https://api.github.com/repos/ceph/ceph-rust/issues/33","id":398283708,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODI4MzcwOA==","user":{"login":"ChrisMacNaughton","id":429739,"node_id":"MDQ6VXNlcjQyOTczOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/429739?v=4","gravatar_id":"","url":"https://api.github.com/users/ChrisMacNaughton","html_url":"https://github.com/ChrisMacNaughton","followers_url":"https://api.github.com/users/ChrisMacNaughton/followers","following_url":"https://api.github.com/users/ChrisMacNaughton/following{/other_user}","gists_url":"https://api.github.com/users/ChrisMacNaughton/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisMacNaughton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisMacNaughton/subscriptions","organizations_url":"https://api.github.com/users/ChrisMacNaughton/orgs","repos_url":"https://api.github.com/users/ChrisMacNaughton/repos","events_url":"https://api.github.com/users/ChrisMacNaughton/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisMacNaughton/received_events","type":"User","site_admin":false},"created_at":"2018-06-19T06:01:03Z","updated_at":"2018-06-19T06:01:03Z","author_association":"COLLABORATOR","body":"Only if we're assuming that the user will never use the pointers directly; it may make more sense to look at splitting the FFI bits into a sub-crate like `ceph-sys`, and keeping only the higher level abstractions in the primary crate"}}
{"actor":{"display_login":"ChrisMacNaughton"}}