#1868 Make sure that tasks queued against deleted artifacts/tools bahave well

unreleased
open
nobody
None
General
nobody
2014-12-17
2011-04-01
No

How to reproduce: import big enough set of tickets (>100). The import will finish, but there will be lengthy background task queue for indexing the tickets. Now delete thing tracker (real world use: user tries a test import, saw some issues, deleted the tracker to retry). See that errors along following lines are logged:

   File "/home/pfalcon/devel/sf.net/forge/Allura/allura/tasks/index_tasks.py", line 23, in add_artifacts
    s = solarize(artifact)
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/lib/search.py", line 31, in solarize
    doc = obj.index()
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/discuss.py", line 338, in index
    result = super(Post, self).index()
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/artifact.py", line 424, in index
    result = Artifact.index(self)
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/artifact.py", line 195, in index
    project = self.project
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/artifact.py", line 138, in project
    return self.app_config.project
    AttributeError: 'NoneType' object has no attribute 'project'
    Traceback (most recent call last):
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/tasks/index_tasks.py", line 23, in add_artifacts
    s = solarize(artifact)
    doc = obj.index()
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/discuss.py", line 338, in index
    result = super(Post, self).index()
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/artifact.py", line 424, in index
    result = Artifact.index(self)
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/artifact.py", line 195, in index
    project = self.project
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/artifact.py", line 138, in project
    return self.app_config.project
    AttributeError: 'NoneType' object has no attribute 'project'
    Traceback (most recent call last):
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/tasks/index_tasks.py", line 23, in add_artifacts
    s = solarize(artifact)
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/lib/search.py", line 31, in solarize
    doc = obj.index()
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/discuss.py", line 253, in index
    result = Artifact.index(self)
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/artifact.py", line 195, in index
    project = self.project
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/artifact.py", line 138, in project
    return self.app_config.project
    AttributeError: 'NoneType' object has no attribute 'project'
    Traceback (most recent call last):
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/tasks/index_tasks.py", line 23, in add_artifacts
    s = solarize(artifact)
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/lib/search.py", line 31, in solarize
    doc = obj.index()
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/discuss.py", line 77, in index
    result = Artifact.index(self)
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/artifact.py", line 195, in index
    project = self.project
      File "/home/pfalcon/devel/sf.net/forge/Allura/allura/model/artifact.py", line 138, in project
    return self.app_config.project
    AttributeError: 'NoneType' object has no attribute 'project'

Discussion

  • Rick Copeland - 2011-04-01

    That seems to be behaving well; it's not crashing anything, is it? It seems we should note indexing operations that can't complete because the artifact is missing....

     
  • Paul Sokolovsky

    Paul Sokolovsky - 2011-04-01

    Well, I don't know, this can fill up log with lots of long backtraces. But it's apparently not high prio, but would be nice to add checks for null pointers. Or maybe even delete tasks related to a tool being deleted (if that info is present in tasks explicitly).

     

Log in to post a comment.