Skip to content

Conversation

divyanshiGupta
Copy link
Contributor

@divyanshiGupta divyanshiGupta commented Sep 7, 2021

Fixes: https://issues.redhat.com/browse/ODC-6320
Fixes: https://issues.redhat.com/browse/ODC-6333

Root Cause:
Large number of groups in name regex causes too-much-recursion error in firefox for basic spring boot sample.

Solution:
Adding the regex matching test in try catch block fixes the issue.

Screen-recording:

Screen.Recording.2021-09-07.at.11.57.25.PM.mov

/kind bug

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 7, 2021
@openshift-ci openshift-ci bot added the component/dev-console Related to dev-console label Sep 7, 2021
@divyanshiGupta
Copy link
Contributor Author

/cc: @rohitkrai03

Copy link
Member

Choose a reason for hiding this comment

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

do we need to have try-catch for .test here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, because for few strings for ex- devfile-sample-java-spring-boot.git and other similar strings there is going to be too much recursion and when the stack overflows the error will be thrown which if not caught will break the UI.
@invincibleJai do you have any other suggestions as to how we can handle this?

Copy link
Contributor

@rohitkrai03 rohitkrai03 Sep 9, 2021

Choose a reason for hiding this comment

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

I think it has to do with how the nameRegex is defined. It does recursive string matching of groups which causes this error. We can change the regex to improve it, something similar to https://stackoverflow.com/questions/43145738/how-to-simplify-this-regex-to-avoid-recursion.

The other thing we can try is to pre compile the regex using new Regex('regex string') instead of doing /regex string/.test().

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can go ahead with this quick fix for now. WDYT @invincibleJai?

Copy link
Contributor

@rohitkrai03 rohitkrai03 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 13, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divyanshiGupta, rohitkrai03

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 13, 2021
@divyanshiGupta divyanshiGupta changed the title Fix basic spring boot sample form crash Bug 2004060: Fix basic spring boot sample form crash Sep 14, 2021
@openshift-ci openshift-ci bot added the bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. label Sep 14, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 14, 2021

@divyanshiGupta: This pull request references Bugzilla bug 2004060, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.10.0) matches configured target release for branch (4.10.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 2004060: Fix basic spring boot sample form crash

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Sep 14, 2021
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@divyanshiGupta
Copy link
Contributor Author

/retest

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 506d042 into openshift:master Sep 14, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 14, 2021

@divyanshiGupta: All pull requests linked via external trackers have merged:

Bugzilla bug 2004060 has been moved to the MODIFIED state.

In response to this:

Bug 2004060: Fix basic spring boot sample form crash

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@divyanshiGupta
Copy link
Contributor Author

/cherrypick release-4.9

@openshift-cherrypick-robot

@divyanshiGupta: cannot checkout 4.9: error checking out 4.9: exit status 1. output: error: pathspec '4.9' did not match any file(s) known to git

In response to this:

/cherrypick 4.9

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-cherrypick-robot

@divyanshiGupta: new pull request created: #10076

In response to this:

/cherrypick release-4.9

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spadgett spadgett added this to the v4.10 milestone Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants