Uploaded image for project: 'Airavata'
  1. Airavata
  2. AIRAVATA-3380

ExperimentViewSet.jobs is slow

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • Django Portal
    • None

    Description

      The ExperimentViewSet.jobs REST API returns the job details for all jobs for an experiment. During some testing of AIRAVATA-3372 I noticed that this REST API was returning slowly, sometimes timing out. I thought this REST API was only calling the Airavata getJobDetails API method, but it turns out in Django REST Framework the ExperimentViewSet.get_queryset() was also getting called; I'm not sure why but it appears that if a @detail_route returns a list of serialized objects (Serializer with many=True) then get_queryset() is called. get_queryset() calls get_list() which for ExperimentViewSet calls the Airavata getUserExperiments API method.

      To fix this I plan to do a couple things:

      • we never used ExperimentViewSet.get_list() to list experiments and the implementation is non-optimal since it doesn't utilize paging, so I'm going to just remove it. The experiment search REST API should be used instead to list experiments.
      • for ViewSets that don't have a list route, I'm going to have the GenericAPIBackedViewSet.get_queryset() method return None instead of calling get_list() so that those ViewSets won't have to implement get_list() just to have a multivalued @detail_route

      Attachments

        Activity

          People

            marcuschristie Marcus Christie
            marcuschristie Marcus Christie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: