Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaged lmdb release fails with "Device Busy" #431

Closed
jcea opened this issue Nov 18, 2016 · 12 comments
Closed

Packaged lmdb release fails with "Device Busy" #431

jcea opened this issue Nov 18, 2016 · 12 comments
Assignees

Comments

@jcea
Copy link

jcea commented Nov 18, 2016

Steps to reproduce:

  1. pkgin install lmdb pip2.7
  2. pip install lmdb
  3. Run the following Python code TWICE:
#!/usr/bin/env python

import lmdb
lmdb.open('/tmp/qq', map_size=512*1024*1024, subdir=True,
          mode=0o700, max_dbs=64, max_readers = 64, max_spare_txns=50)

The first execution creates the database.

If you execute the code again, it will fails with a "Device Busy". This affect too to stock utilities, it is not related to Python. For instance, execute "mdb_dump -a /tmp/qq >/dev/null" after creating the database:

[jcea@Babylon5 /tmp]$ mdb_dump -a /tmp/qq >/dev/null
mdb_env_open failed, error 16 Device busy

It seems that current LMDB development version (not released yet) contains a bug fix for this: Check the two "memset()" lines in https://github.com/dw/py-lmdb/blob/master/lib/mdb.master/mdb.c#L4994 . After paching 0.9.18 release with those two lines, library works as expected.

@mamash mamash self-assigned this Nov 25, 2016
@mamash
Copy link

mamash commented Nov 25, 2016

Do you do not have to install the packaged lmdb at all, the Python lmdb extension uses its own embedded lmdb source instead. For your particular case, you should request a new release for dw/py-lmdb that contains the fix.

I'll backport the fix to the standalone lmdb package (the same fix was already brought to our openldap packages, where embedded source is used too).

As far as I can see, all relevant upstreams fixed the problem, it's just a matter of releases getting pushed out.

@mamash
Copy link

mamash commented Nov 25, 2016

For the record, this is the upstream fix commit:

LMDB/lmdb@c367c1f

@jcea
Copy link
Author

jcea commented Nov 25, 2016

I have configured python-lmdb to use the system version because I am using too the command line tools and I want to be sure that I am using the same version everywhere. But you are right that I should bug the python maintainer to release a new version: jnwatson/py-lmdb#142

Since this is already solved upstream, WHEN can I expect a "pkgin full-upgrade" to get the fix?

@mamash
Copy link

mamash commented Nov 25, 2016

Our pkgsrc production cluster is currently undergoing a full revamp and I'm pretty sure it will take a few more days. I will provide a better ETA as soon as I can.

@jcea
Copy link
Author

jcea commented Nov 30, 2016

I have configured python-lmdb to use the system version because I am using too the command line tools and I want to be sure that I am using the same version everywhere. But you are right that I should bug the python maintainer to release a new version: jnwatson/py-lmdb#142

Since this is already solved upstream, WHEN can I expect a "pkgin full-upgrade" to get the fix?

@mamash
Copy link

mamash commented Nov 30, 2016

And I have no update yet to give you... :)

@jcea
Copy link
Author

jcea commented Dec 15, 2016

Ping... :-?

@jperkin
Copy link
Collaborator

jperkin commented Dec 15, 2016

I've backported this in 0e07fe6 and e2b45f0 and the updated packages should be available later today.

@jcea
Copy link
Author

jcea commented Dec 19, 2016

Should I do anything special?

[root@P2Ppriv ~]# date
December 19, 2016 03:26:16 AM 
[root@P2Ppriv ~]# pkgin update
processing remote summary (https://pkgsrc.joyent.com/packages/SmartOS/2016Q3/x86_64/All)...
database for https://pkgsrc.joyent.com/packages/SmartOS/2016Q3/x86_64/All is up-to-date
[root@P2Ppriv ~]# pkgin full-upgrade
nothing to do.

If this is something only available in future 2016Q4, it is a month away, the fix is trivial and current 2016Q3 version doesn't work at all... :-?

@jperkin
Copy link
Collaborator

jperkin commented Dec 19, 2016

Ah, it was backported to 2015Q4, not 2016Q3. I'm on vacation now but may get a few minutes to work on this.

@jperkin
Copy link
Collaborator

jperkin commented Dec 19, 2016

This should be available in 2016Q3 now.

@jcea
Copy link
Author

jcea commented Dec 19, 2016

Confirmed. It works correctly now. Enjoy your holidays.

Thanks a lot!!.

@jcea jcea closed this as completed Dec 19, 2016
jperkin pushed a commit that referenced this issue Apr 27, 2017
2.7.0
-----

- #p450: Stop after the first installdeps and first testenv create hooks
  succeed.
- #271 and #464: Improve environment information for users.
- #464: Fix incorrect egg-info location for modified package_dir in setup.py.
- #431: Add 'LANGUAGE' to default passed environment variables.
- #455: Add a Vagrantfile with a customized Arch Linux box for local testing.
- #454: Revert #407, empty commands is not treated as an error.
- #446: (infrastructure) Travis CI tests for tox now also run on OS X now.

2.6.0
-----

- add "alwayscopy" config option to instruct virtualenv to always copy
  files instead of symlinking.
- pass setenv variables to setup.py during a usedevelop install.
- replace all references to testrun.org with readthedocs ones.
- fix #323 by avoiding virtualenv14 is not used on py32
- add Python 3.6 to envlist and CI.
- fix glob resolution from TOX_TESTENV_PASSENV env variable

2.5.0
-----

- slightly backward incompatible: fix issue310: the {posargs} substitution
  now properly preserves the tox command line positional arguments. Positional
  arguments with spaces are now properly handled.
- fix #359: add COMSPEC to default passenv on windows.
- add support for py36 and py37 and add py36-dev and py37(nightly) to
  travis builds of tox.
- fix #348: add py2 and py3 as default environments pointing to
  "python2" and "python3" basepython executables.  Also fix #347 by
  updating the list of default envs in the tox basic example.
- make "-h" and "--help-ini" options work even if there is no tox.ini,
- add {:} substitution, which is replaced with os-specific path
  separator
- fix #305: ``downloadcache`` test env config is now ignored as pip-8
  does caching by default.
- output from install command in verbose (-vv) mode is now printed to console instead of
  being redirected to file
- fix #399.  Make sure {envtmpdir} is created if it doesn't exist at the
  start of a testenvironment run.
- fix #316: Lack of commands key in ini file is now treated as an error.
  Reported virtualenv status is 'nothing to do' instead of 'commands
  succeeded', with relevant error message displayed.

2.4.1
-----

- fix issue380: properly perform substitution again.

2.4.0
-----

- remove PYTHONPATH from environment during the install phase because a
  tox-run should not have hidden dependencies and the test commands will also
  not see a PYTHONPATH.
- fix issue352: prevent a configuration where envdir==toxinidir and
  refine docs to warn people about changing "envdir".
- fix issue375, fix issue330: warn against tox-setup.py integration as
  "setup.py test" should really just test with the current interpreter.
- fix issue302: allow cross-testenv substitution where we substitute
  with ``{x,y}`` generative syntax.
- fix issue212: allow escaping curly brace chars "\{" and "\}" if you need the
  chars "{" and "}" to appear in your commands or other ini values.
- addresses issue66: add --workdir option to override where tox stores its ".tox" directory
  and all of the virtualenv environment.
- introduce per-venv list_dependencies_command which defaults
  to "pip freeze" to obtain the list of installed packages.
- close issue66: add documentation to jenkins page on how to avoid
  "too long shebang" lines when calling pip from tox.
- new list_dependencies_command to influence how tox determines
  which dependencies are installed in a testenv.
- (experimental) New feature: When a search for a config file fails, tox tries loading
  setup.cfg with a section prefix of "tox".
- fix issue275: Introduce hooks ``tox_runtest_pre``` and
  ``tox_runtest_post`` which run before and after the tests of a venv,
  respectively.
- fix issue317: evaluate minversion before tox config is parsed completely.
- added the "extras" environment option to specify the extras to use when doing the
  sdist or develop install.
- use pytest-catchlog instead of pytest-capturelog (latter is not
  maintained, uses deprecated pytest API)

2.3.2
-----

- fix issue314: fix command invocation with .py scripts on windows.
- fix issue279: allow cross-section substitution when the value contains
  posargs.

2.3.1
-----

- fix issue294: re-allow cross-section substitution for setenv.

2.3.0
-----

- DEPRECATE use of "indexservers" in tox.ini.
- fix issue285: make setenv processing fully lazy to fix regressions
  of tox-2.2.X and so that we can now have testenv attributes like
  "basepython" depend on environment variables that are set in
  a setenv section.
- allow "#" in commands.
- fix issue289: fix build_sphinx target
- fix issue252: allow environment names with special characters.
- introduce experimental tox_testenv_create(venv, action) and
  tox_testenv_install_deps(venv, action) hooks to allow
  plugins to do additional work on creation or installing
  deps.
- internal: push some optional object creation into tests because
  tox core doesn't need it.

2.2.1
-----

- fix bug where {envdir} substitution could not be used in setenv
  if that env value is then used in {basepython}.

2.2.0
-----

- fix issue265 and add LD_LIBRARY_PATH to passenv on linux by default
  because otherwise the python interpreter might not start up in
  certain configurations (redhat software collections).
- fix issue246: fix regression in config parsing by reordering
  such that {envbindir} can be used again in tox.ini.
- fix issue99: the {env:...} substitution now properly uses environment
  settings from the ``setenv`` section.
- fix issue281: make --force-dep work when urls are present in
  dependency configs.
- fix issue174: add new ``ignore_outcome`` testenv attribute which
  can be set to True in which case it will produce a warning instead
  of an error on a failed testenv command outcome.
- fix issue280: properly skip missing interpreter if
  {envsitepackagesdir} is present in commands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants