Compare commits

...

1 Commits

Author SHA1 Message Date
Julius Härtl fe07c58303
Add verbose logging to object store related operations when assembling chunks
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-05-04 08:23:39 +02:00
5 changed files with 13 additions and 0 deletions

View File

@ -431,6 +431,7 @@ class File extends Node implements IFile {
throw new NotFound();
}
try {
\OC::$server->getLogger()->error('Connector\\Sabre\\File::get() path:' . $this->fileView->getAbsolutePath($this->path) , ['app' => 'debug-s3-chunked-upload']);
$res = $this->fileView->fopen(ltrim($this->path, '/'), 'rb');
} catch (\Exception $e) {
$this->convertToSabreException($e);

View File

@ -292,6 +292,7 @@ class AssemblyStream implements \Icewind\Streams\File {
* @return resource
*/
private function getStream(IFile $node) {
\OC::$server->getLogger()->error("AssemblyStream::getStream() nodes:". count($this->nodes) . " current:$this->currentNode", ['app' => 'debug-s3-chunked-upload']);
$data = $node->get();
if (is_resource($data)) {
return $data;

View File

@ -65,6 +65,10 @@ class FutureFile implements \Sabre\DAV\IFile {
*/
public function get() {
$nodes = $this->root->getChildren();
\OC::$server->getLogger()->error("FutureFile::get for " . $this->root->getName(), ['app' => 'debug-s3-chunked-upload']);
foreach ($nodes as $node) {
\OC::$server->getLogger()->error("FutureFile::get wrap " . $node->getName(), ['app' => 'debug-s3-chunked-upload']);
}
return AssemblyStream::wrap($nodes);
}

View File

@ -291,6 +291,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
}
public function fopen($path, $mode) {
\OC::$server->getLogger()->error('ObjectStoreStorage::fopen(' . $path . ', ' . $mode . ')', ['app' => 'debug-s3-chunked-upload']);
$path = $this->normalizePath($path);
if (strrpos($path, '.') !== false) {
@ -310,6 +311,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
}
try {
\OC::$server->getLogger()->error('IObjectStore::readObject(' . $this->getURN($stat['fileid']) . ')', ['app' => 'debug-s3-chunked-upload']);
return $this->objectStore->readObject($this->getURN($stat['fileid']));
} catch (NotFoundException $e) {
$this->logger->logException($e, [
@ -468,6 +470,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
$stat['etag'] = $this->getETag($path);
$exists = $this->getCache()->inCache($path);
\OC::$server->getLogger()->error("ObjectStoreStorage::writeStream(${path}) exists:" . ($exists ? 'true' : 'false') , ['app' => 'debug-s3-chunked-upload']);
$uploadPath = $exists ? $path : $path . '.part';
if ($exists) {
@ -477,6 +480,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
}
$urn = $this->getURN($fileId);
\OC::$server->getLogger()->error("ObjectStoreStorage::writeObject($urn)" , ['app' => 'debug-s3-chunked-upload']);
try {
//upload to object storage
if ($size === null) {

View File

@ -1151,6 +1151,9 @@ class View {
$run = $this->runHooks($hooks, $path);
/** @var \OC\Files\Storage\Storage $storage */
[$storage, $internalPath] = Filesystem::resolvePath($absolutePath . $postFix);
if ($operation === 'fopen') {
\OC::$server->getLogger()->error('View::fopen storage:' . $storage->getId() . ' internalPath:' . $internalPath, ['app' => 'debug-s3-chunked-upload']);
}
if ($run and $storage) {
if (in_array('write', $hooks) || in_array('delete', $hooks)) {
try {