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 bug where todo attempt was not updated after fetchWork #157

Merged
merged 2 commits into from
Oct 6, 2023

Conversation

marjisound
Copy link
Contributor

@marjisound marjisound commented Oct 6, 2023

What does this change?

When worker calls fetchWork, the resources that have TODO relationships will be returned so the worker can execute the relevant extractors. As part of the fetchWork, the attempts property of the TODO relationship is supposed to get updated. For a strange reason that I didn't fully understand, the query was not updating the TODO attempts. Therefore, everytime the worker is triggered, the task that has already been attempted is returned by the query meaning it's stuck in an infinite loop.

The fix in this PR does the 2 followings:

  • Fix the query so that the todo attempts is updated
  • Add a Extraction_Failure relationship between the relevant resource and the extractor, so that it is known to us that this extractor is not supported. This way the UI also shows that the extractor for the file failed.

How to test

Tested locally

@marjisound marjisound force-pushed the bug-extractor-not-found-failure branch from 9dfd8e3 to eb358d5 Compare October 6, 2023 08:33
@marjisound marjisound force-pushed the bug-extractor-not-found-failure branch from eb358d5 to 4c74abb Compare October 6, 2023 08:34
@marjisound marjisound marked this pull request as ready for review October 6, 2023 09:24
@marjisound marjisound requested a review from a team as a code owner October 6, 2023 09:24
@marjisound marjisound marked this pull request as draft October 6, 2023 10:02
@marjisound marjisound force-pushed the bug-extractor-not-found-failure branch 3 times, most recently from 82a22ba to 8a731a0 Compare October 6, 2023 10:52
@marjisound marjisound force-pushed the bug-extractor-not-found-failure branch from 8a731a0 to 3f5fa3c Compare October 6, 2023 11:18
@marjisound marjisound marked this pull request as ready for review October 6, 2023 11:36
@marjisound marjisound changed the title fix the bug where todo attempt was not being updated in neo4j fix bug where todo attempt was not being updated in neo4j Oct 6, 2023
@marjisound marjisound changed the title fix bug where todo attempt was not being updated in neo4j fix bug where todo attempt was not updated after fetchWork Oct 6, 2023
Copy link
Contributor

@itsibitzi itsibitzi left a comment

Choose a reason for hiding this comment

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

Nice one!

Cypher is a bit of a mystery to me... Slightly disinclined to (re)learn it since I think we ultimately would like to move to PostgreSQL anyway

@marjisound marjisound merged commit fbbb7c5 into main Oct 6, 2023
1 check passed
@marjisound marjisound deleted the bug-extractor-not-found-failure branch October 6, 2023 14:00
@zekehuntergreen zekehuntergreen mentioned this pull request Oct 13, 2023
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.

2 participants