wallet: Releases dangling files on BerkeleyEnvironment::Close #15297

pull promag wants to merge 3 commits into bitcoin:master from promag:2019-01-close-dbenv-files changing 4 files +22 −0
  1. promag commented at 0:33 am on January 31, 2019: member

    This PR closes db.log and removes .walletlock files when BerkeleyEnvironment is closed.

    Fixes #15291 (comment).

  2. gmaxwell commented at 0:39 am on January 31, 2019: contributor
    Concept ACK
  3. fanquake added the label Wallet on Jan 31, 2019
  4. promag commented at 1:16 am on January 31, 2019: member
    Please add to 0.18 milestone.
  5. fanquake added this to the milestone 0.18.0 on Jan 31, 2019
  6. in src/wallet/db.cpp:131 in 9eb2077e1e outdated
    125@@ -126,6 +126,10 @@ void BerkeleyEnvironment::Close()
    126         }
    127     }
    128 
    129+    FILE* error_file = nullptr;
    130+    dbenv->get_errfile(&error_file);
    131+    if (error_file) fclose(error_file);
    


    promag commented at 7:42 am on January 31, 2019:
    Maybe this should be after dbenv->close(0).
  7. promag force-pushed on Jan 31, 2019
  8. MarcoFalke commented at 5:16 pm on January 31, 2019: member
    Needs rebase
  9. promag force-pushed on Jan 31, 2019
  10. promag commented at 5:40 pm on January 31, 2019: member
    Rebased.
  11. fanquake added this to the "In progress" column in a project

  12. practicalswift commented at 8:01 pm on February 1, 2019: contributor
    Concept ACK
  13. promag force-pushed on Feb 3, 2019
  14. wallet: Close dbenv error file db.log
    The error file db.log is opened by BerkeleyEnvironment instance and
    should be closed after dbenv is closed.
    8602a1e6ae
  15. wallet: Close wallet env lock file
    Close .walletlock file when a BerkeleyEnvironment is deleted.
    2f8b8f479b
  16. promag force-pushed on Feb 4, 2019
  17. ryanofsky approved
  18. ryanofsky commented at 6:16 pm on February 4, 2019: member
    utACK 2f8b8f479bb43729ca2ff40929e8463347b0b7b4. Nice cleanup!
  19. qa: Test .walletlock file is closed d3bf3b930d
  20. promag commented at 6:53 pm on February 4, 2019: member
    Thanks @ryanofsky, pushed a test that fails without this PR.
  21. ryanofsky approved
  22. ryanofsky commented at 7:39 pm on February 4, 2019: member
    utACK d3bf3b930d34da7d121ae35b4fb75865ed73208c. Just added test since the previous review.
  23. laanwj commented at 7:49 pm on February 4, 2019: member
    utACK 2f8b8f479bb43729ca2ff40929e8463347b0b7b4
  24. fanquake commented at 4:23 pm on February 5, 2019: member

    utACK d3bf3b9

    master (fc21bb4):

     0src/qt/bitcoin-qt
     1
     2lsof -p 56700 | grep wallet
     3bitcoin-q 56700 michael   24u     REG                1,4        0  4556196 /Users/michael/Library/Application Support/Bitcoin/wallets/.walletlock
     4bitcoin-q 56700 michael   25w     REG                1,4        0  4556198 /Users/michael/Library/Application Support/Bitcoin/wallets/db.log
     5bitcoin-q 56700 michael   33u     REG                1,4  1048576 26847564 /Users/michael/Library/Application Support/Bitcoin/wallets/database/log.0000000001
     6bitcoin-q 56700 michael   39w     REG                1,4        0  4556198 /Users/michael/Library/Application Support/Bitcoin/wallets/db.log
     7
     8src/bitcoin-cli unloadwallet ""
     9
    10lsof -p 56700 | grep wallet
    11bitcoin-q 56700 michael   24u     REG                1,4        0  4556196 /Users/michael/Library/Application Support/Bitcoin/wallets/.walletlock
    12bitcoin-q 56700 michael   25w     REG                1,4        0  4556198 /Users/michael/Library/Application Support/Bitcoin/wallets/db.log
    13bitcoin-q 56700 michael   39w     REG                1,4        0  4556198 /Users/michael/Library/Application Support/Bitcoin/wallets/db.log
    

    This PR:

    0src/qt/bitcoin-qt
    1
    2lsof -p 54793 | grep wallet
    3bitcoin-q 54793 michael   36u      REG                1,4        0  4556196 /Users/michael/Library/Application Support/Bitcoin/wallets/.walletlock
    4bitcoin-q 54793 michael   37w      REG                1,4        0  4556198 /Users/michael/Library/Application Support/Bitcoin/wallets/db.log
    5bitcoin-q 54793 michael   38u      REG                1,4  1048576 26847564 /Users/michael/Library/Application Support/Bitcoin/wallets/database/log.0000000001
    6
    7src/bitcoin-cli unloadwallet ""
    8
    9lsof -p 54793 | grep wallet
    
  25. meshcollider merged this on Feb 5, 2019
  26. meshcollider closed this on Feb 5, 2019

  27. meshcollider referenced this in commit 30e799a5f7 on Feb 5, 2019
  28. jnewbery moved this from the "In progress" to the "Done" column in a project

  29. promag deleted the branch on Feb 11, 2019
  30. promag commented at 8:21 pm on February 11, 2019: member
    Should be backport?
  31. fanquake added the label Needs backport on Feb 11, 2019
  32. MarcoFalke removed this from the milestone 0.18.0 on Mar 6, 2019
  33. MarcoFalke added this to the milestone 0.17.2 on Mar 6, 2019
  34. promag referenced this in commit 5e495fe22a on Mar 10, 2019
  35. promag referenced this in commit 0f94e32cbb on Mar 10, 2019
  36. promag referenced this in commit 88f55c5578 on Mar 10, 2019
  37. fanquake removed the label Needs backport on Mar 11, 2019
  38. fanquake commented at 0:51 am on March 11, 2019: member
    Being backported in #15575.
  39. promag referenced this in commit 06f44c53e1 on Mar 11, 2019
  40. promag referenced this in commit 7097ead059 on Mar 11, 2019
  41. promag referenced this in commit 84e8adbf3e on Mar 11, 2019
  42. promag referenced this in commit 592a095883 on Mar 11, 2019
  43. promag referenced this in commit 662f8f81fa on Mar 11, 2019
  44. promag referenced this in commit 940109dabf on Mar 11, 2019
  45. promag referenced this in commit 22cdb6cf59 on Mar 12, 2019
  46. promag referenced this in commit 2e9e904a5d on Mar 12, 2019
  47. promag referenced this in commit fe95f84542 on Mar 12, 2019
  48. laanwj referenced this in commit 6cf81b01b4 on Mar 20, 2019
  49. sidhujag referenced this in commit fa1e446245 on Mar 28, 2019
  50. sidhujag referenced this in commit dcca439cce on Mar 28, 2019
  51. sidhujag referenced this in commit 0be38b1efc on Mar 28, 2019
  52. sidhujag referenced this in commit 3ee64a0aa7 on Mar 28, 2019
  53. uhliksk referenced this in commit 22f2a130cc on Apr 21, 2019
  54. uhliksk referenced this in commit 39e8c710e1 on Apr 21, 2019
  55. uhliksk referenced this in commit 9634824ffc on Apr 21, 2019
  56. Rishabh42 referenced this in commit ce3547fae6 on Apr 22, 2019
  57. uhliksk referenced this in commit f509f52a62 on May 1, 2019
  58. uhliksk referenced this in commit 325f960ecc on May 1, 2019
  59. uhliksk referenced this in commit 3da7701426 on May 1, 2019
  60. linuxsh2 referenced this in commit 38b7c6cc7f on Jul 30, 2021
  61. linuxsh2 referenced this in commit 7195f7cdf7 on Aug 3, 2021
  62. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 18:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me