vmware-archive / go-pmem-transaction

Golang library for using persistent memory
Other
29 stars 5 forks source link

Export Unlock API #21

Closed jerrinsg closed 5 years ago

jerrinsg commented 5 years ago

Making the unlock API public so that users can unlock all locks acquired so far without ending the transaction.

Needed as redis client now calls transaction End() only after completely processing the request pipeline, but wants to drop locks after processing each command - https://github.com/vmware-samples/go-redis-pmem/pull/5

pratapsu commented 5 years ago

This change looks good to me.

mohit10verma commented 5 years ago

Hi @jerrinsg @pratapsu This will be a bug if a user unlocks the data structures before transaction ends, and a different thread sees the updates made within this transaction. Now if the transaction crashes, we'll revert these updates, but we can't revert the other threads seeing this update.

jerrinsg commented 5 years ago

Hi Mohit, Thanks for pointing this out. I have created a new pull request (#30) that reverts these changes.