Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A autojump
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 158
    • Issues 158
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 54
    • Merge requests 54
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • William Ting
  • autojump
  • Issues
  • #358
Closed
Open
Issue created Mar 09, 2015 by Administrator@rootContributor

`move_file` may cause data loss

Created by: lilydjwg

Days ago I found autojump forgot some of my frequent paths. After reading the code, I think this may be caused by that move_file isn't really atomic.

My system is Arch Linux and autojump version is v22.2.4.

On saving paths, autojump creates a temporary file, which by default, is in /tmp. /tmp isn't on the same filesystem with my autojump data file, so when move_file calls shutil.move, what really happens is copy and then delete. It's not atomic. Running with strace I can see there are multiple write calls to the data file. When multiple processes hit here, interweaving writes will result in a partial loss.

I suggest you use a temporary file in the same directory as the data file. I can provide a patch if you accept doing it this way.

Assignee
Assign to
Time tracking