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

[BUG] Analysis of application with is causing applications to disappear due to deadlock #121

Closed
1 task done
dymurray opened this issue Aug 5, 2024 · 4 comments · Fixed by #122
Closed
1 task done
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/release-blocker Must be staffed and worked in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@dymurray
Copy link
Contributor

dymurray commented Aug 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Konveyor version

latest

Priority

Blocker

Current Behavior

Running analysis is leading to errors in the hub about a Unique Constraint being violated and then causes the application inventory to be empty. There are also errors about deps.yaml not existing.

Expected Behavior

Analysis should succeed.

How Reproducible

Always (Default)

Steps To Reproduce

  1. Create application for https://github.com/kissaten/gradle-multi-project-example
  2. Analyze source only with target of openjdk21
  3. Add custom rule:
- category: mandatory
  description: |
    This rule looks for a given annotation used with another annotation
  message: "Annotation instpection 05"
  ruleID: java-annotation-inspection-05
  labels:
  - konveyor.io/target=openjdk21
  when:
    java.referenced:
      pattern: org.springframework.context.annotation.Configuration
      location: ANNOTATION
      annotated:
        pattern: org.springframework.data.jpa.repository.config.EnableJpaRepositories
        elements:
          - name: basePackages
            value: "io.konveyor.demo.ordermanagement.repository"

- category: mandatory
  customVariables: []
  description: MicroProfile Metrics not supported
  effort: 1
  labels:
  - konveyor.io/target=openjdk21
  - JBossEAP
  - EAPXP
  links: []
  message: If you migrate your application to JBoss EAP XP 5.0 (or later), please
    note that MicroProfile Metrics is not supported.
  ruleID: gradle-sample-rule
  when:
    java.referenced:
      pattern: com.sun.net.httpserver.HttpServer
      location: IMPORT
  1. Run analysis

Environment

- OS:

Anything else?

tackle-hub-7879cc4ff9-75dct-tackle-hub.log
Screenshot from 2024-08-05 14-28-22
task-7-v2cks-addon.log

Check the task logs to see the deps.yaml error. Check the screenshot to see the UI network requests sit in pending forever. Check the hub pod logs to see the unique constraint error.

@dymurray dymurray added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 5, 2024
@konveyor-ci-bot
Copy link

This issue is currently awaiting triage.
If contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.
The triage/accepted label can be added by org members.

@konveyor-ci-bot konveyor-ci-bot bot added the needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. label Aug 5, 2024
@dymurray dymurray added this to the v0.5.1 milestone Aug 5, 2024
@dymurray dymurray added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Aug 5, 2024
@konveyor-ci-bot konveyor-ci-bot bot removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. labels Aug 5, 2024
@dymurray
Copy link
Contributor Author

dymurray commented Aug 5, 2024

Deleting the hub pod causes the UI to resolve itself and the applications come back into the inventory. The associated analysis actually fails with the following details
log-merged-7.json

@dymurray
Copy link
Contributor Author

dymurray commented Aug 6, 2024

Retesting on the same environment and this is not 100% reproducible any longer, in fact I'm unable to reproduce it right now.

@dymurray
Copy link
Contributor Author

dymurray commented Aug 6, 2024

Reproducer scenarios:

NOT reproducible in v0.5.0

@jortel jortel transferred this issue from konveyor/tackle2-hub Aug 6, 2024
@konveyor-ci-bot konveyor-ci-bot bot added the needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. label Aug 6, 2024
@dymurray dymurray changed the title [BUG] Analysis of gradle application with custom rule is causing applications to disappear [BUG] Analysis of application with is causing applications to disappear due to deadlock Aug 6, 2024
@dymurray dymurray modified the milestones: v0.5.1, v0.5.2 Aug 6, 2024
@dymurray dymurray added the priority/release-blocker Must be staffed and worked in time for the next release. label Aug 6, 2024
@konveyor-ci-bot konveyor-ci-bot bot removed the needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. label Aug 6, 2024
@dymurray dymurray moved this from 🆕 New to ✅ Done in Planning Aug 6, 2024
github-actions bot pushed a commit that referenced this issue Aug 6, 2024
closes #121

The `addon.Activity()` reports addon activity which is appended to the
TaskReport.Activity using a PUT. This will briefly acquire a DB
transaction (in the hub).
The builder MUST not report activity because the addon already has a
transaction open in the hub because of the POST of the analysis report.
This creates a DEADLOCK.

**There is a race-condition**: This only happens when the hub begins the
transaction before the dep writer reports the dep.yaml not found. I can
force this by adding a sleep to where the writer reports this. I suspect
the hub can be busy enough with UI GET requests to delay it beginning
the analysis POST until after the builder reports the file not found.

Flow:
```
addon                    hub
   | post analysis ----- >|
   |                      | begin tx
   | writer <-------------| read
   | writer: put task --> | begin tx (deadlock)
```

Regression added PR #97

Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Cherry Picker <noreply@github.com>
dymurray pushed a commit that referenced this issue Aug 6, 2024
closes #121

The `addon.Activity()` reports addon activity which is appended to the
TaskReport.Activity using a PUT. This will briefly acquire a DB
transaction (in the hub).
The builder MUST not report activity because the addon already has a
transaction open in the hub because of the POST of the analysis report.
This creates a DEADLOCK.

**There is a race-condition**: This only happens when the hub begins the
transaction before the dep writer reports the dep.yaml not found. I can
force this by adding a sleep to where the writer reports this. I suspect
the hub can be busy enough with UI GET requests to delay it beginning
the analysis POST until after the builder reports the file not found.

Flow:
```
addon                    hub
   | post analysis ----- >|
   |                      | begin tx
   | writer <-------------| read
   | writer: put task --> | begin tx (deadlock)
```

Regression added PR #97

Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Cherry Picker <noreply@github.com>

Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Cherry Picker <noreply@github.com>
Co-authored-by: Jeff Ortel <jortel@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/release-blocker Must be staffed and worked in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants