Skip to content
This repository has been archived by the owner on Mar 9, 2019. It is now read-only.

Release read-write Tx after close #413

Merged
merged 1 commit into from
Sep 4, 2015

Conversation

benbjohnson
Copy link
Member

Overview

This pull request removes references to the last write transaction and and its dirty pages after the transaction has been closed. This bug did not affect the safety of the data, however, it would cause dirty pages to linger in-memory until the next write transaction began.

This commit removes references to the last write transaction and
and its dirty pages after the transaction has been closed. This
bug did not affect the safety of the data, however, it would
cause dirty pages to linger in-memory until the next write
transaction began.
@benbjohnson
Copy link
Member Author

/cc @pauldix

@@ -250,7 +251,12 @@ func (tx *Tx) close() {
} else {
tx.db.removeTx(tx)
}

// Clear all references.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put this stuff in a defer? Would it make sense? Perhaps the code is just clearer down here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function doesn't have any other exit points. I'm not sure a defer would help.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense.

benbjohnson added a commit that referenced this pull request Sep 4, 2015
Release read-write Tx after close
@benbjohnson benbjohnson merged commit 0c24824 into boltdb:master Sep 4, 2015
@benbjohnson benbjohnson deleted the release-rwtx branch September 4, 2015 21:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants