Revert "Fix Blockstore XBlock Runtime's handling of occasional S3 errors"

This commit is contained in:
David Ormsbee
2020-03-12 15:09:23 -04:00
committed by GitHub
parent d15402db8d
commit 09c5432415
6 changed files with 25 additions and 50 deletions

View File

@@ -180,9 +180,7 @@ class BlockstoreFieldData(FieldData):
# Otherwise, this is an anomalous get() before the XML was fully loaded:
# This could happen if an XBlock's parse_xml() method tried to read a field before setting it,
# if an XBlock read field data in its constructor (forbidden), or if an XBlock was loaded via
# some means other than runtime.get_block(). One way this can happen is if you log/print an XBlock during
# XML parsing, because ScopedStorageMixin.__repr__ will try to print all field values, and any fields which
# aren't mentioned in the XML (which are left at their default) will be "not loaded yet."
# some means other than runtime.get_block()
log.exception(
"XBlock %s tried to read from field data (%s) that wasn't loaded from Blockstore!",
block.scope_ids.usage_id, name,

View File

@@ -13,7 +13,7 @@ from xblock.fields import ScopeIds
from openedx.core.djangoapps.xblock.learning_context.manager import get_learning_context_impl
from openedx.core.djangoapps.xblock.runtime.runtime import XBlockRuntime
from openedx.core.djangoapps.xblock.runtime.olx_parsing import parse_xblock_include, BundleFormatException
from openedx.core.djangoapps.xblock.runtime.olx_parsing import parse_xblock_include
from openedx.core.djangoapps.xblock.runtime.serializer import serialize_xblock
from openedx.core.djangolib.blockstore_cache import (
BundleCache,
@@ -85,12 +85,7 @@ class BlockstoreXBlockRuntime(XBlockRuntime):
This runtime API should normally be used via
runtime.get_block() -> block.parse_xml() -> runtime.add_node_as_child
"""
try:
parsed_include = parse_xblock_include(node)
except BundleFormatException:
# We need to log the XBlock ID or this will be hard to debug
log.error("BundleFormatException when parsing XBlock %s", block.scope_ids.usage_id)
raise # Also log details and stack trace
parsed_include = parse_xblock_include(node)
self.add_child_include(block, parsed_include)
def add_child_include(self, block, parsed_include):

View File

@@ -27,9 +27,6 @@ def parse_xblock_include(include_node):
# An XBlock include looks like:
# <xblock-include source="link_id" definition="block_type/definition_id" usage="alias" />
# Where "source" and "usage" are optional.
if include_node.tag != 'xblock-include':
# xss-lint: disable=python-wrap-html
raise BundleFormatException("Expected an <xblock-include /> XML node, but got <{}>".format(include_node.tag))
try:
definition_path = include_node.attrib['definition']
except KeyError: