foundationdb icon indicating copy to clipboard operation
foundationdb copied to clipboard

Go binding: fix bug with R/O transaction destroyed before futures, add GC references for db/tx

Open gm42 opened this issue 1 year ago • 18 comments

Fix bug with R/O transaction destroyed before futures, add GC references for db/tx

In a previous PR the R/O transaction was optimized and the finalizer was removed; however this prevents using any future, since transaction is already destroyed by the time future is attempted evaluation.

Additionally, a new issue is uncovered and addressed: the Go Database, Transaction and Future objects are all garbage-collected independently, which is incorrect because Database and Transaction must not be garbage-collected if any future has not yet been garbage-collected.

A test has been added to verify that futures work right after their creation within a ReadTransact call.

Code-Reviewer Section

  • [x] The PR has a description, explaining both the problem and the solution.
  • [x] The description mentions which forms of testing were done and the testing seems reasonable.
  • [x] Every function/class/actor that was touched is reasonably well documented.

For Release-Branches

If this PR is made against a release-branch, please also check the following:

  • [ ] This change/bugfix is a cherry-pick from the next younger branch (younger release-branch or main if this is the youngest branch)
  • [ ] There is a good reason why this PR needs to go into a release branch and this reason is documented (either in the description above or in a linked GitHub issue)

gm42 avatar Aug 27 '24 14:08 gm42

Cc @johscheuer

gm42 avatar Aug 27 '24 14:08 gm42

Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 0:07:15
  • Result: :x: FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /opt/homebrew/bin/bash --login -c ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 27 '24 18:08 foundationdb-ci

Result of foundationdb-pr-macos on macOS Ventura 13.x

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 0:11:52
  • Result: :x: FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /usr/local/bin/bash --login -c ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 27 '24 18:08 foundationdb-ci

Result of foundationdb-pr-clang-ide on Linux CentOS 7

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 0:20:31
  • Result: :white_check_mark: SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 27 '24 18:08 foundationdb-ci

Result of foundationdb-pr on Linux CentOS 7

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 0:41:13
  • Result: :x: FAILED
  • Error: Error while executing command: ctest -j ${NPROC} --no-compress-output -T test --output-on-failure. Reason: exit status 8
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 27 '24 19:08 foundationdb-ci

Result of foundationdb-pr-clang-arm on Linux CentOS 7

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 0:51:14
  • Result: :white_check_mark: SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 27 '24 19:08 foundationdb-ci

Result of foundationdb-pr-cluster-tests on Linux CentOS 7

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 0:56:41
  • Result: :white_check_mark: SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

foundationdb-ci avatar Aug 27 '24 19:08 foundationdb-ci

Result of foundationdb-pr-clang on Linux CentOS 7

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 1:22:05
  • Result: :white_check_mark: SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 27 '24 20:08 foundationdb-ci

It looks like I cannot see the reason for the failures :thinking:

Edit: found the logs, they look like errors in compiling fdbmonitor

gm42 avatar Aug 28 '24 06:08 gm42

Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 0:06:55
  • Result: :x: FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /opt/homebrew/bin/bash --login -c ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 28 '24 13:08 foundationdb-ci

Result of foundationdb-pr-macos on macOS Ventura 13.x

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 0:11:53
  • Result: :x: FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /usr/local/bin/bash --login -c ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 28 '24 13:08 foundationdb-ci

Result of foundationdb-pr-clang-ide on Linux CentOS 7

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 0:21:41
  • Result: :white_check_mark: SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 28 '24 13:08 foundationdb-ci

Result of foundationdb-pr-clang-arm on Linux CentOS 7

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 0:54:26
  • Result: :white_check_mark: SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 28 '24 13:08 foundationdb-ci

Result of foundationdb-pr-cluster-tests on Linux CentOS 7

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 1:00:03
  • Result: :white_check_mark: SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

foundationdb-ci avatar Aug 28 '24 13:08 foundationdb-ci

Result of foundationdb-pr on Linux CentOS 7

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 3:00:30
  • Result: :x: FAILED
  • Error: Build has timed out.
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 28 '24 15:08 foundationdb-ci

Result of foundationdb-pr-clang on Linux CentOS 7

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 3:00:35
  • Result: :x: FAILED
  • Error: Build has timed out.
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 28 '24 15:08 foundationdb-ci

Result of foundationdb-pr on Linux CentOS 7

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 3:00:40
  • Result: :x: FAILED
  • Error: Build has timed out.
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 28 '24 19:08 foundationdb-ci

Result of foundationdb-pr-clang on Linux CentOS 7

  • Commit ID: 1780932466b56388fad0d24e8e9adb07ee827129
  • Duration 3:00:40
  • Result: :x: FAILED
  • Error: Build has timed out.
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 28 '24 19:08 foundationdb-ci

Removed the private createTransaction() since it was now identical to CreateTransaction().

gm42 avatar Aug 30 '24 07:08 gm42

Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x

  • Commit ID: fe23dbb15bbf0681974e36d55d8618f1e0fadaa3
  • Duration 0:07:09
  • Result: :x: FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /opt/homebrew/bin/bash --login -c ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 30 '24 15:08 foundationdb-ci

Result of foundationdb-pr-macos on macOS Ventura 13.x

  • Commit ID: fe23dbb15bbf0681974e36d55d8618f1e0fadaa3
  • Duration 0:11:35
  • Result: :x: FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /usr/local/bin/bash --login -c ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 30 '24 16:08 foundationdb-ci

Result of foundationdb-pr-clang-ide on Linux CentOS 7

  • Commit ID: fe23dbb15bbf0681974e36d55d8618f1e0fadaa3
  • Duration 0:21:47
  • Result: :white_check_mark: SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 30 '24 16:08 foundationdb-ci

Result of foundationdb-pr-clang-arm on Linux CentOS 7

  • Commit ID: fe23dbb15bbf0681974e36d55d8618f1e0fadaa3
  • Duration 0:53:57
  • Result: :white_check_mark: SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 30 '24 16:08 foundationdb-ci

Result of foundationdb-pr-cluster-tests on Linux CentOS 7

  • Commit ID: fe23dbb15bbf0681974e36d55d8618f1e0fadaa3
  • Duration 0:57:38
  • Result: :white_check_mark: SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

foundationdb-ci avatar Aug 30 '24 16:08 foundationdb-ci

Result of foundationdb-pr-clang on Linux CentOS 7

  • Commit ID: fe23dbb15bbf0681974e36d55d8618f1e0fadaa3
  • Duration 3:00:31
  • Result: :x: FAILED
  • Error: Build has timed out.
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 30 '24 18:08 foundationdb-ci

Result of foundationdb-pr on Linux CentOS 7

  • Commit ID: fe23dbb15bbf0681974e36d55d8618f1e0fadaa3
  • Duration 3:00:41
  • Result: :x: FAILED
  • Error: Build has timed out.
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Aug 30 '24 18:08 foundationdb-ci

Result of foundationdb-pr-clang on Linux CentOS 7

  • Commit ID: fe23dbb15bbf0681974e36d55d8618f1e0fadaa3
  • Duration 0:50:18
  • Result: :white_check_mark: SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Sep 05 '24 00:09 foundationdb-ci

Result of foundationdb-pr on Linux CentOS 7

  • Commit ID: fe23dbb15bbf0681974e36d55d8618f1e0fadaa3
  • Duration 0:58:01
  • Result: :white_check_mark: SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Sep 05 '24 00:09 foundationdb-ci

Re-based.

gm42 avatar Sep 05 '24 10:09 gm42

Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x

  • Commit ID: ab937dd4ffbfe3f02d71b0e604d3bb770a8bd71c
  • Duration 0:07:10
  • Result: :x: FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /opt/homebrew/bin/bash --login -c ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

foundationdb-ci avatar Sep 06 '24 12:09 foundationdb-ci