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

BlockServer: Fails with untracked directories #2624

Closed
AdrianPotter opened this issue Sep 20, 2017 · 8 comments
Closed

BlockServer: Fails with untracked directories #2624

AdrianPotter opened this issue Sep 20, 2017 · 8 comments

Comments

@AdrianPotter
Copy link

Owing to changes to the BlockServer as part of #2574, I now get frequent errors of the form:

[Tue Sep 19 13:22:51 2017] MINOR: Error in loading config: 'Diff' object has no attribute 'a_path'

From investigation, this appears to arise because of untracked files in my git repository.

This appears to be having significant knock on effects in the GUI. It has trouble setting the current configuration at startup and requires a reload of the required configuration.

This change was not included in release 4.0.0 but must be fixed prior to the next release to avoid serious issues.

I "fixed" this locally by chaning line 272 in git_version_control.py to:

c1 = [ item.a_blob.abspath for item in self.repo.index.diff(None) ]

However, this is just another in a long line of issues with our use of git and the file watcher. As part of this ticket we should discuss and map all of the use cases that the system should meet.

  • What happens when a new untracked file is added
  • What happens when there are untracked files when the BlockServer starts
  • What happens when an untracked file is changed
  • What happens when an untracked file is deleted
  • Which files/folders should be monitored
  • Which (if any) files should be fixed by the FileWatcher
  • How do we ensure that the file watcher and version control threads do not fight each other
  • What happens if a tracked file has uncommited changes at startup
  • What happens when a tracked file is deleted by the user while the block server is active
  • What happens when a tracked file is deleted while the block server is switched off

That's just a subset of questions that need clear answers with tests and clear handling mechanisms within the code. The current system is ok but I've seen this error along with the file watcher and version control getting into an infinite loop as part of the current master version.

@AdrianPotter
Copy link
Author

See also: #2417, #2367

@FreddieAkeroyd
Copy link
Member

Do you get the same problem if you update GitPython ?

@FreddieAkeroyd
Copy link
Member

My system is in a bit of a state at the moment, but I did have untracked directories in my settings area when I was testing, but likely had updated GitPython at that point.

@AdrianPotter
Copy link
Author

I haven't had a chance to try it. My release is equivalent to 4.0.0. If an updated version of GitPython is needed, that might solve this issue. If that's the case, then I'm currently doing #2548 which would sort it. Refactoring would still be good at some point, but fixing the failure is the first priority of this ticket.

@kjwoodsISIS kjwoodsISIS added this to the SPRINT_2017_09_21 milestone Sep 21, 2017
@John-Holt-Tessella
Copy link
Contributor

Have a try at creating a test which includes creating a real git repository with items added to it (If possible a fake one with credentials to access)

@kjwoodsISIS kjwoodsISIS added 2 and removed proposal labels Sep 21, 2017
@AdrianPotter
Copy link
Author

As suggested, the bug does not occur with the latest version of Python Git. This needs fully testing with the creation of suitable tests, if possible, as part of this ticket

@ThomasLohnert
Copy link
Contributor

@ThomasLohnert
Copy link
Contributor

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

No branches or pull requests

6 participants