-
Notifications
You must be signed in to change notification settings - Fork 219
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
Make load_sample_data
more resilient
#2479
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One major error resulting from a typo, but it's such a quick fix that I'll commit it and give this the approval.
Edit: typo fixed in b53e266
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice change, but I don't think it resolves the linked issue. Calls to the ingestion server return a task ID. If that task fails the script will continue on without issue. The call to ingest the test data, for example, only checks if the index is created afterwards before moving on, not that the task actually finished or succeeded.
The reason to convert to Python is that it would be way easier to parse the request body for the task ID and make repeated requests to the task endpoint of the ingestion server. The PR you mentioned didn't do that either, to be fair, and I think overcomplicated things by reusing the just recipes and adding new functionality, rather than converting the script as is. I don't think that previous PR is necessarily a good comparison or an indication that re-writing to Python doesn't make certain aspects of it easier. The linked PR did a lot more than re-write to Python and add checks on the task IDs.
Anyway, this is a change that we should merge, but I don't think it fully resolves the issue as the tasks can still fail and the script would go on anyway.
if [ $STATUS_CODE -lt 200 ] || [ $STATUS_CODE -ge 300 ]; then \ | ||
echo "Status: $STATUS_CODE"; \ | ||
exit 1; \ | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was surprised by this because I assumed cURL supported some kind of method for changing the exit code if the status was bad. It turns out there's a relatively new feature (2021) that does this: --fail-with-body
. It has the added benefit of still printing the response body with the failure without needing to add any more flags (or checks).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't use that because a lot of us are developing on macOS and might have an older version of cURL built-in. Installing a new version of cURL is technically an option but I experienced SSL issues when I last did that and I didn't want to force an additional system-level dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, TIL that macOS is on an old version 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not only cURL, macOS comes bundled with plenty of old utils.
I also had problems with Git when I tried to use some new feature (can't recall what it was), didn't have it, installed Git with Brew which then refused to work with SSH proto. It was a whole thing to reset everything 😢.
I changed "Fixes ..." to "Addresses ..." to leave the linked issue open after merging this PR. |
Fixes
Addresses #2359 by @sarayourfriend
Description
This PR makes these changes:
DELETE
and\copy
to the database.This PR does not rewrite the script in a different language, like Python, for two reasons:
just
recipe invocations. Switching to Python will not improve any inherent fragility in those recipes.Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin