Skip to content

Fix reopen cleanup in PHP LevelDB#53

Open
reeze wants to merge 1 commit intomasterfrom
zqfg8d-codex/find-and-fix-a-bug-in-codebase
Open

Fix reopen cleanup in PHP LevelDB#53
reeze wants to merge 1 commit intomasterfrom
zqfg8d-codex/find-and-fix-a-bug-in-codebase

Conversation

@reeze
Copy link
Owner

@reeze reeze commented Jun 4, 2025

Summary

  • ensure comparator and callable resources are released when reopening a DB
  • reset internal DB pointer to avoid double close
  • free block cache objects on reopen or error
  • add test for block_cache_size reopen logic

Testing

  • make test TESTS=tests/022-block-cache.phpt
  • make test TESTS=tests

https://chatgpt.com/codex/tasks/task_e_683fca06d404832785bd2dd1bf232737

Copy link
Collaborator

@dktapps dktapps left a comment

Choose a reason for hiding this comment

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

Formatting is a disastrous mess, & looks like this also has multiple unrelated changes

Copy link
Collaborator

@dktapps dktapps left a comment

Choose a reason for hiding this comment

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

I feel like the code for cleaning up options, comparator etc seems to get repeated in a few different places. Probably worth making a function for it.

zend_throw_exception(php_leveldb_ce_LevelDBException, err, 0);
leveldb_free(err);
return;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure this is needed, I think the free_obj handler should take care of it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants