{"action":"closed","issue":{"url":"https://api.github.com/repos/jflesch/pyinsane/issues/19","repository_url":"https://api.github.com/repos/jflesch/pyinsane","labels_url":"https://api.github.com/repos/jflesch/pyinsane/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/jflesch/pyinsane/issues/19/comments","events_url":"https://api.github.com/repos/jflesch/pyinsane/issues/19/events","html_url":"https://github.com/jflesch/pyinsane/issues/19","id":59901499,"number":19,"title":"Abstract threaded scans lock task threading","user":{"login":"rmackinnon","id":3688637,"avatar_url":"https://avatars.githubusercontent.com/u/3688637?v=3","gravatar_id":"","url":"https://api.github.com/users/rmackinnon","html_url":"https://github.com/rmackinnon","followers_url":"https://api.github.com/users/rmackinnon/followers","following_url":"https://api.github.com/users/rmackinnon/following{/other_user}","gists_url":"https://api.github.com/users/rmackinnon/gists{/gist_id}","starred_url":"https://api.github.com/users/rmackinnon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmackinnon/subscriptions","organizations_url":"https://api.github.com/users/rmackinnon/orgs","repos_url":"https://api.github.com/users/rmackinnon/repos","events_url":"https://api.github.com/users/rmackinnon/events{/privacy}","received_events_url":"https://api.github.com/users/rmackinnon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2015-03-05T03:52:54Z","updated_at":"2016-10-26T15:42:22Z","closed_at":"2016-10-26T15:42:22Z","body":"The problem we're running into is, once a scan is initiated and the image is retrieved, there is no way to garbage collect the now dead session and end the thread safely.  It remains alive holding the device hostage.  Any attempt to .cancel() or \\_\\_del\\_\\_() the scan/session object results in python hanging/deadlocking.\r\n\r\nAn strace reveals that it's sitting on a FUTEX_WAIT_PRIVATE:\r\nioctl(0, SNDCTL_TMR_STOP or SNDRV_TIMER_IOCTL_GINFO or TCSETSW, {B38400 opost isig icanon echo ...}) = 0\r\nrt_sigaction(SIGWINCH, {SIG_DFL, [], SA_RESTORER, 0x7fc3f45b30e0}, {0x7fc3ee3c5a50, [], SA_RESTORER|SA_RESTART, 0x7fc3f45b30e0}, 8) = 0\r\nfutex(0x248d0d0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>\r\n\r\nIt's 100% percent repeatable here:\r\n```\r\n#!/usr/bin/python2.7\r\nimport pyinsane.abstract_th as pyinsane\r\ndev = pyinsane.get_devices()\r\ntmp = dev[0].scan()\r\ntry:\r\n    while true:\r\n        tmp.scan.read()\r\nexcept EOFError:\r\n    pass\r\ntmp.scan.cancel()\r\n#or \r\ntmp.scan.__del__()\r\n```\r\nMaybe we're not quite understanding how to end and start a new thread/session?"}}
{"actor":{"display_login":"jflesch"}}