The local temporary file might not live long enough to be
copied into storage during post-send.
Bug: T128124
Change-Id: Ifb5260958db008ec8b9f4db90f95a42e5ecaeadc
}
$realOps = $this->substOpBatchPaths( $ops, $backend );
}
$realOps = $this->substOpBatchPaths( $ops, $backend );
- if ( $this->asyncWrites ) {
+ if ( $this->asyncWrites && !$this->hasStoreOperation( $ops ) ) {
// Bind $scopeLock to the callback to preserve locks
DeferredUpdates::addCallableUpdate(
function() use ( $backend, $realOps, $opts, $scopeLock ) {
// Bind $scopeLock to the callback to preserve locks
DeferredUpdates::addCallableUpdate(
function() use ( $backend, $realOps, $opts, $scopeLock ) {
+ /**
+ * @param array $ops File operation batch map
+ * @return bool
+ */
+ protected function hasStoreOperation( array $ops ) {
+ foreach ( $ops as $op ) {
+ if ( $op['op'] === 'store' ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
protected function doQuickOperationsInternal( array $ops ) {
$status = Status::newGood();
// Do the operations on the master backend; setting Status fields...
protected function doQuickOperationsInternal( array $ops ) {
$status = Status::newGood();
// Do the operations on the master backend; setting Status fields...
}
$realOps = $this->substOpBatchPaths( $ops, $backend );
}
$realOps = $this->substOpBatchPaths( $ops, $backend );
- if ( $this->asyncWrites ) {
+ if ( $this->asyncWrites && !$this->hasStoreOperation( $ops ) ) {
DeferredUpdates::addCallableUpdate(
function() use ( $backend, $realOps ) {
$backend->doQuickOperations( $realOps );
DeferredUpdates::addCallableUpdate(
function() use ( $backend, $realOps ) {
$backend->doQuickOperations( $realOps );