Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • W wendelin.core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Activity
  • Graph
  • Commits
Collapse sidebar
  • Kirill Smelkov
  • wendelin.core
  • Repository
  • wendelin.core
  • bigfile
  • tests
  • test_basic.py
Find file BlameHistoryPermalink
  • Kirill Smelkov's avatar
    XY bigfile/py: Garbage-collect BigFile <=> BigFileH cycles · 1be4d730
    Kirill Smelkov authored Nov 08, 2020
    Since ZBigFile keeps references to fileh objects that are created
    through it it forms a file <=> fileh cycle that is not collected without
    cyclic GC:
    
    https://lab.nexedi.com/nexedi/wendelin.core/blob/v0.13-52-ga702d41/bigfile/file_zodb.py#L497
    https://lab.nexedi.com/nexedi/wendelin.core/blob/v0.13-52-ga702d41/bigfile/file_zodb.py#L566-571
    
    We did not noticed this leak until now because it is small, but with
    upcoming wendelin.core 2 it is important to release a fileh, because
    there is WCFS connection associated with fileh, and if fileh is not
    released, that connection also stays alive, keeping on-WCFS resources
    still being used, and preventing WCFS from being unmounted cleanly.
    
    -> Add cyclic GC support to PyBigFile / PyBigFileH
    
    NOTE: we still don't allow PyVMA <=> PyBigFileH cycles to be collected,
    because fileh_close called from fileh.__del__ asserts that there are no
    live mappings left. See added comments for details. There is no
    known practical need to use such cycles, so this should be ok.
    
    See also other patches on cyclic GC topic:
    
    - 450ad804 (bigarray: ArrayRef support for BigArray)  // adds cyclic GC support for PyVMA
    - d97641d2 (bigfile/py: Properly untrack PyVMA from GC before dealloc)
    1be4d730
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7