mozilla-services/android-sync — comment on commit fea9469130a7fc44ea71d7a2a377c2823359f822
File: src/main/java/org/mozilla/gecko/sync/stage/SyncClientsEngineStage.java line 76
By rnewman:

I mean you don't close the DB in `handleRequestFailure` or `handleRequestError`, so if the `GET` fails the DB is never closed.

But my first question was: you're opening the DB in init, and closing it here. That's slightly confusing, because you make *two* HTTP requests. One has to read carefully to notice that the delegate for one is `this` and the other is `clientUploadDelegate`. At the very least you ought to cluster the `GET`-related requests together; you should probably also consider putting some of this logic in a separate method or two, and calling it from this generic-looking HTTP handler.