1. 29 Aug, 2022 2 commits
  2. 05 Aug, 2022 1 commit
  3. 29 Jul, 2022 1 commit
    • Piotr Batko's avatar
      Remove race condition during creation of directory for SQLiteFile · 79156254
      Piotr Batko authored
      When multiple instances of beem was run in parallel, following error appeared
      from time to time (the detailed content of error is attached at the very bottom):
      ```
      >           mkdir(name, mode)
      E           FileExistsError: [Errno 17] File exists: '/root/.local/share/beem'
      /usr/lib/python3.8/os.py:223: FileExistsError
      ```
      
      I assume that problem occured, because two processes at the same time checked
      if directory exists. Both received same answer -- directory doesn't exists.
      So first successfully created the directory, and second one failed with this
      error.
      
      Solution implemented in this commit, is to accept situation, when directory
      already exists.
      
      Detailed error description:
      ```
      /builds/hive/hive/venv/lib/python3.8/site-packages/beem-0.24.22-py3.8.egg/beem/blockchaininstance.py:186: in __init__
          self.config = kwargs.get("config_store", get_default_config_store(**kwargs))
      /builds/hive/hive/venv/lib/python3.8/site-packages/beem-0.24.22-py3.8.egg/beem/storage.py:46: in get_default_config_store
          return generate_config_store(SqliteConfigurationStore, blockchain="hive")(*args, **kwargs)
      /builds/hive/hive/venv/lib/python3.8/site-packages/beem-0.24.22-py3.8.egg/beemstorage/sqlite.py:198: in __init__
          SQLiteFile.__init__(self, *args, **kwargs)
      /builds/hive/hive/venv/lib/python3.8/site-packages/beem-0.24.22-py3.8.egg/beemstorage/sqlite.py:59: in __init__
          os.makedirs(self.data_dir)
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
      name = '/root/.local/share/beem', mode = 511, exist_ok = False
          def makedirs(name, mode=0o777, exist_ok=False):
              """makedirs(name [, mode=0o777][, exist_ok=False])
      
              Super-mkdir; create a leaf directory and all intermediate ones.  Works like
              mkdir, except that any intermediate path segment (not just the rightmost)
              will be created if it does not exist. If the target directory already
              exists, raise an OSError if exist_ok is False. Otherwise no exception is
              raised.  This is recursive.
      
              """
              head, tail = path.split(name)
              if not tail:
                  head, tail = path.split(head)
              if head and tail and not path.exists(head):
                  try:
                      makedirs(head, exist_ok=exist_ok)
                  except FileExistsError:
                      # Defeats race condition when another thread created the path
                      pass
                  cdir = curdir
                  if isinstance(tail, bytes):
                      cdir = bytes(curdir, 'ASCII')
                  if tail == cdir:           # xxx/newdir/. exists if xxx/newdir exists
                      return
              try:
      >           mkdir(name, mode)
      E           FileExistsError: [Errno 17] File exists: '/root/.local/share/beem'
      /usr/lib/python3.8/os.py:223: FileExistsError
      ```
      79156254
  4. 05 May, 2021 2 commits
  5. 02 May, 2021 1 commit
  6. 28 Apr, 2021 3 commits
  7. 19 Apr, 2021 3 commits
  8. 05 Apr, 2021 1 commit
  9. 30 Mar, 2021 1 commit
  10. 29 Mar, 2021 3 commits
  11. 20 Mar, 2021 1 commit
  12. 19 Mar, 2021 3 commits
  13. 16 Mar, 2021 1 commit
  14. 15 Mar, 2021 2 commits
  15. 13 Mar, 2021 2 commits
  16. 12 Mar, 2021 7 commits
  17. 08 Mar, 2021 3 commits
  18. 01 Mar, 2021 1 commit
  19. 15 Feb, 2021 2 commits