@@ -133,10 +133,6 @@ def push_project_async(mc, directory):
133133 total_size = 0
134134 # prepare file chunks for upload
135135 for file in upload_files :
136- # do checkpoint to push changes from wal file to gpkg if there is no diff
137- if "diff" not in file and mp .is_versioned_file (file ["path" ]):
138- do_sqlite_checkpoint (mp .fpath (file ["path" ]))
139- file ["checksum" ] = generate_checksum (mp .fpath (file ["path" ]))
140136 file ['location' ] = mp .fpath_meta (file ['diff' ]['path' ]) if 'diff' in file else mp .fpath (file ['path' ])
141137
142138 for chunk_index , chunk_id in enumerate (file ["chunks" ]):
@@ -210,16 +206,17 @@ def push_project_finalize(job):
210206 resp = job .mc .post ("/v1/project/push/finish/%s" % job .transaction_id )
211207 job .server_resp = json .load (resp )
212208 except ClientError as err :
213- job .mc .post ("/v1/project/push/cancel/%s" % job .transaction_id )
214209 # server returns various error messages with filename or something generic
215210 # it would be better if it returned list of failed files (and reasons) whenever possible
216- return {'error' : str (err )}
217-
218- if 'error' in job .server_resp :
219- #TODO would be good to get some detailed info from server so user could decide what to do with it
220- # e.g. diff conflicts, basefiles issues, or any other failure
221- job .mp .log .error ("push failed. server response: " + job .server_resp ['error' ])
222- raise ClientError (job .server_resp ['error' ])
211+ job .mp .log .error ("--- push finish failed! " + str (err ))
212+
213+ # if push finish fails, the transaction is not killed, so we
214+ # need to cancel it so it does not block further uploads
215+ job .mp .log .info ("canceling the pending transaction..." )
216+ resp_cancel = job .mc .post ("/v1/project/push/cancel/%s" % job .transaction_id )
217+ server_resp_cancel = json .load (resp_cancel )
218+ job .mp .log .info ("cancel response: " + str (server_resp_cancel ))
219+ raise err
223220
224221 job .mp .metadata = {
225222 'name' : job .project_path ,
0 commit comments