{"action":"created","issue":{"url":"https://api.github.com/repos/cjfields/redmine-test/issues/139","labels_url":"https://api.github.com/repos/cjfields/redmine-test/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/cjfields/redmine-test/issues/139/comments","events_url":"https://api.github.com/repos/cjfields/redmine-test/issues/139/events","html_url":"https://github.com/cjfields/redmine-test/issues/139","id":110329457,"number":139,"title":"Making Bio::DB::Fasta Storable and thread safe","user":{"login":"cjfields","id":49265,"avatar_url":"https://avatars.githubusercontent.com/u/49265?v=3","gravatar_id":"","url":"https://api.github.com/users/cjfields","html_url":"https://github.com/cjfields","followers_url":"https://api.github.com/users/cjfields/followers","following_url":"https://api.github.com/users/cjfields/following{/other_user}","gists_url":"https://api.github.com/users/cjfields/gists{/gist_id}","starred_url":"https://api.github.com/users/cjfields/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjfields/subscriptions","organizations_url":"https://api.github.com/users/cjfields/orgs","repos_url":"https://api.github.com/users/cjfields/repos","events_url":"https://api.github.com/users/cjfields/events{/privacy}","received_events_url":"https://api.github.com/users/cjfields/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cjfields/redmine-test/labels/Category:%20Core%20Components","name":"Category: Core Components","color":"006699"},{"url":"https://api.github.com/repos/cjfields/redmine-test/labels/Component:%20URL","name":"Component: URL","color":"ededed"},{"url":"https://api.github.com/repos/cjfields/redmine-test/labels/Priority:%20Normal","name":"Priority: Normal","color":"666600"},{"url":"https://api.github.com/repos/cjfields/redmine-test/labels/Status:%20In%20Progress","name":"Status: In Progress","color":"CC6600"},{"url":"https://api.github.com/repos/cjfields/redmine-test/labels/Tracker:%20Bug","name":"Tracker: Bug","color":"FF0000"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-07T22:16:26Z","updated_at":"2015-10-07T22:16:30Z","closed_at":null,"body":"---\n\n\nAuthor Name: **Florent Angly** (@fangly)\nOriginal Redmine Issue: 3397, https://redmine.open-bio.org/issues/3397\nOriginal Date: 2012-11-28\nOriginal Assignee: Florent Angly\n\n---\n\nIssue initially raised by Carson Holt in bug \\#3390:\n\"\nThe thread safe idea has to do with returning values from the thread or with shared between threads variables. The most common way to handle these types of values in Perl is to use the Storable module to serialize objects and move data around. Interfaces like DB\\_File don’t serialize correctly, so STORABLE\\_freeze and STORABLE\\_thaw are hooks that Storable looks for to tell it how to serialize and deserialize these complex objects. Basically you just need to untie the offsets hash on serialization in the STORABLE\\_freeze hook and then tie it again in the STORABLE\\_thaw hook.\n\nAlso I’m not sure if you’ve done this, but it was something I noticed about the previous Bio::DB::Fasta. The tied hash does not flush to the file until it is untied at least once after creation, so if I create a new DB and then try and connect from another process before the original one has untied at least once then the DB is partial or empty. I think it would make sense that just when creating a new index, that the object untie the offsets hash once and then retie it to force the flush. You may have already done this.\n\"\n\n\n\n\n"},"comment":{"url":"https://api.github.com/repos/cjfields/redmine-test/issues/comments/146348319","html_url":"https://github.com/cjfields/redmine-test/issues/139#issuecomment-146348319","issue_url":"https://api.github.com/repos/cjfields/redmine-test/issues/139","id":146348319,"user":{"login":"cjfields","id":49265,"avatar_url":"https://avatars.githubusercontent.com/u/49265?v=3","gravatar_id":"","url":"https://api.github.com/users/cjfields","html_url":"https://github.com/cjfields","followers_url":"https://api.github.com/users/cjfields/followers","following_url":"https://api.github.com/users/cjfields/following{/other_user}","gists_url":"https://api.github.com/users/cjfields/gists{/gist_id}","starred_url":"https://api.github.com/users/cjfields/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjfields/subscriptions","organizations_url":"https://api.github.com/users/cjfields/orgs","repos_url":"https://api.github.com/users/cjfields/repos","events_url":"https://api.github.com/users/cjfields/events{/privacy}","received_events_url":"https://api.github.com/users/cjfields/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T22:16:30Z","updated_at":"2015-10-07T22:16:30Z","body":"---\n\nOriginal Redmine Comment\nAuthor Name: **Florent Angly** \nOriginal Date: 2012-12-03T02:11:39Z\n\n---\n\nSee this branch: https://github.com/bioperl/bioperl-live/tree/storable\\_db\nSupport for serialization and synchronicity added.\n\n"}}