Skip to content

Saving ParseObjects with save() sometimes take several minutes. #250

@krausegil

Description

@krausegil

The problem:
Sometimes saving parse objects using the save() function takes several minutes.
In those 2-15 minutes the save function will not return.

Background:
In our app, for each Class that we want to save to the servers, we create a class extending ParseObject, using an inheritance tree. For example:
Both class ParseDog and class ParseCat extends ParsePet, which in turn extends ParseObjectWrapper. Some classes like ParseNotification extends ParseObjectWrapper directly.
For users we use the built in ParseUser class.

We do all our work with parse in a closed parse module.

We have Objects which reference other objects (always from another class), we use reference arrays, and so on.
We do all relations as recommended in the parse documentation.

Other issues that might be worth mentioning:

  • We had a big issue with ConcurrentModificationException. Eventually we had to use a read-write lock for all objects, so if we write 1 object, we don't read any object even if it is from a completely unrelated class.
  • When running in debug mode, parse usually works very slow.
  • The app is still in beta. So a load issue is unlikely. Yet, sometimes we get above the 30 calls / second limit at midnight, and then it drops back to almost zero.
  • We use saveAll() a lot, but till 2 month ago we didn't, and we had the same problem back then too.

More about the problem:

  • Usually, once it happens, it will happen from all devices for several hours and up to a day.
  • Sometimes it will happen only for few devices / users. In those cases usually some objects will get saved normally while others won't, and the issue will remain for days.
  • Using saveInBackground doesn't help. We tried and the callback function have never be called or it took several minutes.
  • We don't have any issues with reading from the server.
  • We tried to flatten the inheritance tree (remove the classes ParseObjectWrapper & ParsePet). This did not help.

Links to other bugs that we thought might be relevant:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions