GitHub PullRequestReviewCommentEvent at 2014-06-05 06:05:09
Repository: core
Actor: kacfengine
Payload: {"comment":{"url":"https://api.github.com/repos/cfengine/core/pulls/comments/13425458","id":13425458,"diff_hunk":"@@ -134,9 +134,16 @@ static int GetWriteTransaction(DBPriv *db, MDB_txn **txn)\n static void AbortTransaction(DBPriv *db)\n {\n     DBTxn *db_txn = pthread_getspecific(db->txn_key);\n-    mdb_txn_abort(db_txn->txn);\n-    db_txn->txn = NULL;\n-    db_txn->rw_txn = false;\n+    if (db_txn != NULL)\n+    {\n+        if (db_txn->txn != NULL)\n+        {\n+            mdb_txn_abort(db_txn->txn);\n+        }\n+\n+        pthread_setspecific(db->txn_key, NULL);","path":"libpromises/dbm_lmdb.c","position":14,"original_position":14,"commit_id":"e5babd5904efff0466eab7eee307e46292e1c0fb","original_commit_id":"e5babd5904efff0466eab7eee307e46292e1c0fb","user":{"login":"kacfengine","id":4037094,"avatar_url":"https://avatars.githubusercontent.com/u/4037094?","gravatar_id":"051c8986741264f2671890948d4f4d30","url":"https://api.github.com/users/kacfengine","html_url":"https://github.com/kacfengine","followers_url":"https://api.github.com/users/kacfengine/followers","following_url":"https://api.github.com/users/kacfengine/following{/other_user}","gists_url":"https://api.github.com/users/kacfengine/gists{/gist_id}","starred_url":"https://api.github.com/users/kacfengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kacfengine/subscriptions","organizations_url":"https://api.github.com/users/kacfengine/orgs","repos_url":"https://api.github.com/users/kacfengine/repos","events_url":"https://api.github.com/users/kacfengine/events{/privacy}","received_events_url":"https://api.github.com/users/kacfengine/received_events","type":"User","site_admin":false},"body":"I suppose it's possible to be interrupted by a signal handler in between here (``AbortTransaction`` can happen in normal operation, as well as in the signal handler), but I'm not sure how to protect against that. Using signal handlers to do this kind of stuff is evil anyway, but that's the kind of mess we're in. :-P","created_at":"2014-06-05T06:05:09Z","updated_at":"2014-06-05T06:05:09Z","html_url":"https://github.com/cfengine/core/pull/1741#discussion_r13425458","pull_request_url":"https://api.github.com/repos/cfengine/core/pulls/1741","_links":{"self":{"href":"https://api.github.com/repos/cfengine/core/pulls/comments/13425458"},"html":{"href":"https://github.com/cfengine/core/pull/1741#discussion_r13425458"},"pull_request":{"href":"https://api.github.com/repos/cfengine/core/pulls/1741"}}}}