@@ -1912,12 +1912,9 @@ async def _run_operation(
19121912 :param address: Optional address when sending a message
19131913 to a specific server, used for getMore.
19141914 :param operation_telemetry: The calling cursor's operation span, or None,
1915- so this send's command spans nest under it. Covers one caller-driven
1916- getMore, or a whole API call that drains the cursor itself.
1917- :param reuse_current_span: Create no operation span at all and leave the
1918- ambient span in place as the parent for this operation's command
1919- spans. Mutually exclusive with ``operation_telemetry``. Defaults to
1920- False.
1915+ so this send's command spans nest under it.
1916+ :param reuse_current_span: Leave the ambient span as the parent for this
1917+ operation's command spans, creating none, defaults to False.
19211918 """
19221919 if operation .conn_mgr :
19231920 server = await self ._select_server (
@@ -2028,13 +2025,9 @@ async def _retry_internal(
20282025 :param operation_id: Stable operation id shared across retries, defaults to None
20292026 :param operation_telemetry: A cursor's operation span, which this call
20302027 makes current but neither creates nor ends, defaults to None.
2031- :param reuse_current_span: Create no operation span at all and leave the
2032- ambient span in place as the parent for this operation's command
2033- spans. For callers that know a suitable operation span is already
2034- current, where a second one would be spurious (the client
2035- bulk-write results cursor's getMores, which belong under the
2036- enclosing bulkWrite span). Mutually exclusive with
2037- ``operation_telemetry``. Defaults to False.
2028+ :param reuse_current_span: Leave the ambient span as the parent for this
2029+ operation's command spans, creating none. Mutually exclusive with
2030+ ``operation_telemetry``, defaults to False.
20382031
20392032 :return: Output of the calling func()
20402033 """
@@ -2087,10 +2080,7 @@ async def _retryable_read(
20872080 :param is_aggregate_write: If this is a aggregate operation with a write, defaults to False.
20882081 :param operation_id: Stable operation id shared across retries, defaults to None
20892082 :param operation_telemetry: As for ``_retry_internal``, defaults to None.
2090- :param reuse_current_span: Create no operation span at all and leave the
2091- ambient span in place as the parent for this operation's command
2092- spans. Mutually exclusive with ``operation_telemetry``. Defaults to
2093- False.
2083+ :param reuse_current_span: As for ``_retry_internal``, defaults to False.
20942084 """
20952085
20962086 # Ensure that the client supports retrying on reads and there is no session in
@@ -2133,15 +2123,12 @@ async def _retryable_read_cursor(
21332123 """Run a command cursor read within its own operation span.
21342124
21352125 Takes the same arguments as :meth:`_retryable_read`, plus the namespace
2136- for the span. A command cursor's first batch is fetched inside that
2137- call, before the cursor exists, so the span cannot be owned by the
2138- cursor the way a find cursor's is; create it here instead.
2139-
2140- The span ends with the command that created the cursor. Later getMores
2141- belong to whoever drives iteration: each one the caller drives gets an
2142- operation span of its own, so only a public API call that drains the
2143- cursor itself (see ``_otel.internal_cursor_iteration``) keeps this one
2144- open, by handing it to the cursor.
2126+ for the span. A command cursor's first batch is fetched before the cursor
2127+ exists, so the span cannot be owned by the cursor and is created here.
2128+
2129+ The span ends with the creating command, unless a public API call
2130+ draining the cursor itself (see ``_otel.internal_cursor_iteration``)
2131+ keeps it open by handing it to the cursor.
21452132 """
21462133 operation_telemetry = _operation_telemetry_or_none (
21472134 self .options .tracing ,
@@ -3041,9 +3028,8 @@ def __init__(
30413028 self ._operation_id = operation_id
30423029 if reuse_current_span and operation_telemetry is not None :
30433030 raise ValueError ("reuse_current_span and operation_telemetry are mutually exclusive" )
3044- # With nothing passed in, create the span here and end it in run(); with a
3045- # span passed in, the caller owns it. reuse_current_span means an enclosing
3046- # span is already current, so this object creates none.
3031+ # With nothing passed in, create the span here and end it in run(); with
3032+ # a span passed in, or reuse_current_span, an outer caller owns it.
30473033 self ._owns_telemetry = operation_telemetry is None and not reuse_current_span
30483034 if self ._owns_telemetry :
30493035 operation_telemetry = _operation_telemetry_or_none (
0 commit comments