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

ui: prevent statement/transaction page from sending infinite API #70941

Closed

Conversation

Azhng
Copy link
Contributor

@Azhng Azhng commented Sep 30, 2021

requests when the API requests fails

Previously, Statement Page and Transaction Page issues API requests
in conmponentDidUpdate() React lifecycle hook. However, when the
backend API returns an error, this lifecycle hook is constantly
triggered which resulted in infinite loop. This crashes the entire
frontend application.
This commit removes API calls from within the componentDidUpdate()
hooks.

Resolves #68602

Release note: None

requests when the API requests fails

Previously, Statement Page and Transaction Page issues API requests
in conmponentDidUpdate() React lifecycle hook. However, when the
backend API returns an error, this lifecycle hook is constantly
triggered which resulted in infinite loop. This crashes the entire
frontend application.
This commit removes API calls from within the componentDidUpdate()
hooks.

Resolves cockroachdb#68602

Release note: None
@Azhng Azhng requested a review from a team September 30, 2021 17:27
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @Azhng and @maryliag)


pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx, line 267 at r1 (raw file):

      this.props.onSearchComplete(this.filteredStatementsData());
    }
    this.refreshStatements();

the data keeps getting refreshed so we get the latest data, removing this means we will might have stale data. What is the reason for removing this here?

@xinhaoz
Copy link
Member

xinhaoz commented Sep 30, 2021


pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx, line 267 at r1 (raw file):

Previously, maryliag (Marylia Gutierrez) wrote…

the data keeps getting refreshed so we get the latest data, removing this means we will might have stale data. What is the reason for removing this here?

Ah it seems like because we receive an error the data is considered invalid, so we'll continue to refresh the data instead of adhering to the caching period..... what is the expected behaviour when we get an API error? Endlessly fetching until we get a valid result doesn't seem quite right.

@Azhng Azhng removed the GA-blocker label Sep 30, 2021
@Azhng Azhng closed this May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQL activity pages (sessions, transactions and statements) are empty during an active workload
4 participants