Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix discovery dispatch accumulating errors #3272

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

arbulu89
Copy link
Contributor

@arbulu89 arbulu89 commented Feb 3, 2025

Description

The dispatch function was failing in some circumstances if the 1st command failed but the 2nd worked.
I saw this behaviour running the hana-scale-up-cost-opt photofinish scenario.
In reality, we don't have any flagrant error, as by coincidence the correct command is the 2nd and last, so the commands are properly dispatched to the domain code. The failure was that we were returning 500 error in the collect endpoint (and we had more SAP instances in the payload, they wouldn't be handled).

This was the error log in web:

14:16:33.482 [error] #PID<0.1014.0> running Phoenix.Endpoint.SyncCodeReloadPlug (connection #PID<0.1004.0>, stream id 2) terminated
Server: localhost:4000 (http)
Request: POST /api/v1/collect
** (exit) an exception was raised:
    ** (CaseClauseError) no case clause matching: {:ok, {:error, [:database_not_registered]}}
        (trento 2.4.0+git.dev88.1738570035.d87bd8166) lib/trento/discovery.ex:170: anonymous fn/2 in Trento.Discovery.dispatch/1
        (elixir 1.15.7) lib/enum.ex:2510: Enum."-reduce/3-lists^foldl/2-0-"/3

How was this tested?

UT

@arbulu89 arbulu89 added the bug Something isn't working label Feb 3, 2025
@arbulu89 arbulu89 requested a review from EMaksy February 3, 2025 13:43
Copy link
Member

@EMaksy EMaksy left a comment

Choose a reason for hiding this comment

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

Hey thanks for catching this very nasty bug !

@arbulu89 arbulu89 merged commit f6f638f into main Feb 3, 2025
75 checks passed
@arbulu89 arbulu89 deleted the fix-discovery-dispatch-accumulating-errors branch February 3, 2025 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants