Skip to content

Conversation

@datadog-agent-integrations-bot
Copy link
Contributor

@datadog-agent-integrations-bot datadog-agent-integrations-bot bot commented Jan 12, 2026

Ignore this PR. Just used to test a workflow.

Backport 7477060 from #22252.


What does this PR do?

Prevents JSON decode errors when the Spark driver is starting but not quite ready.

Motivation

Customer inquiry via support ticket.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

* Fix for Spark driver init readiness pending

* Add changelog

* Lint

* Add config param for retries

* Simplify description

* Address comments

* Update spark/assets/configuration/spec.yaml

Co-authored-by: Steven Yuen <[email protected]>

* ddev sync models and config

---------

Co-authored-by: Steven Yuen <[email protected]>
(cherry picked from commit 7477060)
@steveny91 steveny91 changed the title [Backport 7.74.x] Fix for Spark driver init readiness pending Test [Backport 7.74.x] Fix for Spark driver init readiness pending Jan 12, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: caf90d5b2d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 666 to +680
except JSONDecodeError as e:
response_text = response.text.strip()
if response_text and 'spark is starting up' in response_text.lower():
# Handle startup message based on retry configuration
if self._startup_wait_retries > 0:
self._startup_retry_count += 1
if self._startup_retry_count <= self._startup_wait_retries:
self.log.debug(
"Spark driver not ready yet at %s (attempt %d/%d): %s",
self._get_url_base(address),
self._startup_retry_count,
self._startup_wait_retries,
response_text,
)
return None

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid returning None from JSON parser

When the driver returns the startup banner, _rest_request_to_json now returns None. Callers like _driver_init immediately iterate the result (for app_json in metrics_json) without a None guard, which will raise a TypeError and still fail the check in the exact “driver starting up” scenario this change targets. This means the JSONDecodeError is replaced by an unhandled exception and the check won’t gracefully retry. Consider returning an empty list/dict or handling None in the driver-init path before iterating.

Useful? React with 👍 / 👎.

@steveny91 steveny91 marked this pull request as draft January 12, 2026 20:34
@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 98.68421% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (7.74.x@bf9ee89). Learn more about missing BASE report.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants