Closed tehhowch closed 6 years ago
Current workaround:
Eventually this too will fail, or will need to be done so often that the permissive maintenance function will be worthless to use.
Possible fixes:
or
Still happening regularly - is definitely related to the size of the upload.
hypothesis:
It's possible the hang is because the call is not async - the script waits around to receive the status, and times out before it gets the status, and thus (whether or not the task was successful), fails to update the rest of the system about the successful clean.
Making the doReplace
return void
isn't helpful. It appears the empty response is due to using the innate Google Apps Script FusionTables API and having a large CSV to upload (large being >= 10MB).
The Google Apps Script FusionTables API naturally does not provide any documentation at all, beyond its very limited, example-free "intellisense" (instead referring to the FusionTables v2 API).
The FusionTables API does describe multipart & resumable uploads, but provides only non-apps-script examples. Either the Google Apps Script FusionTables API does not support multipart/resumable, or it does but no one at Google has cared to document it (equally likely IMO).
My solution going forward is to develop a standalone prune tool (likely a python or JS browser script) that can be executed on my own resources and can utilize the latest available language features (and the full FusionTables v2 API).
With https://github.com/tehhowch/apps-script/commit/a1c267e3c651d78586db3c4358b72b08e34d6931 I am now able to perform maintenance actions (mass deletions & then importrow) for a csv that is ~14000 kB on disk without issue, even without using a resumeable request. At some point that'll need to be done, but that point isn't now.
When the database grows to a certain size (hypothesis), calls to .replaceRows() fail with an empty response. This situation has arisen twice with MHCC so far (May 18th & April 22-26ish) since the implementation of the FusionTables interface.
This
empty response
occurs when running the permissive maintenance function, resulting in a halt to scoreboard updates.