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

Add tests for data objects stuck in locked status, prevent nullptr dereference (4-2-stable) #2097

Merged
merged 7 commits into from
Feb 20, 2023

Conversation

alanking
Copy link
Contributor

@alanking alanking commented Feb 10, 2023

Addresses #2092
Addresses #2095
Addresses irods/irods#6154
Addresses irods/irods#6479
Addresses irods/irods#6880

Companion PR: irods/irods#6905
Companion PR: irods/externals#181

Cherry-picked from #2094
Cherry-picked from #2093

Leaving in draft for now because building the plugin doesn't quite work. Might need to do something in irods/externals first...

@korydraughn
Copy link
Contributor

Should we wait to review this?

@alanking
Copy link
Contributor Author

This can be reviewed now as it is nearly identical to #2094, just reserving the right to do some unannounced force-pushing :p

@korydraughn
Copy link
Contributor

Will review as soon as i get an opening.

@alanking
Copy link
Contributor Author

irods/externals#181 is required along with the current set of changes in order to build the plugin. Will start running tests soon. Marking as ready for review since I do not expect to make any more dramatic changes outside of review comments.

@alanking alanking marked this pull request as ready for review February 10, 2023 21:11
@alanking
Copy link
Contributor Author

When I tried to run tests for this, it seemed to be infinitely stuck and a lot of error messages were coming out of MinIO. Will need to investigate. Everything leading up to running the tests (including running the test hook) seems fine now.

@alanking
Copy link
Contributor Author

A couple of things happened, preventing the tests from passing here:

  1. Running two MinIO servers on the same host seems to be causing some problems when running tests in the testing environment. Not sure why this hasn't cropped up before, but it is causing problems now. I ran a single MinIO server and tests started running normally. As such, I created this issue to address these problems: Test hook: Running multiple MinIO servers on the same host seems to cause problems #2101
  2. A bug was discovered while trying to run my new tests in that an error is not being returned when copying data to S3 fails during sync-to-archive. @JustinKyleJames found the fix, which I've replicated in the latest commit. I am happy to drop that commit so he can get proper credit, but this set of changes causes tests to pass.

So... everything passes now, yay

@korydraughn
Copy link
Contributor

This can be reviewed now as it is nearly identical to #2094, just reserving the right to do some unannounced force-pushing :p

Is this PR still nearly identical to #2094? Is there anything we need to look at specifically since the new commits?

@alanking
Copy link
Contributor Author

The only things that should be different at this point are the changes to the test hook to chown the keypair file (which is different because of python2) and the latest commit which addresses #2100 (which needs its commit message updated and/or @JustinKyleJames should make that change in a separate PR). So, it's still nearly identical save for those two things.

Copy link
Contributor

@korydraughn korydraughn left a comment

Choose a reason for hiding this comment

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

Changes look good. Will await outcome with @JustinKyleJames regarding commit ownership before approving this PR.

@JustinKyleJames
Copy link
Contributor

Changes look good. Will await outcome with @JustinKyleJames regarding commit ownership before approving this PR.

Commit looks good and I think I am fine with the ownership being as is.

@alanking
Copy link
Contributor Author

Thanks! Squashed and added coauthorship to that last commit.

Copy link
Contributor

@korydraughn korydraughn left a comment

Choose a reason for hiding this comment

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

Add the pounds!

alanking and others added 7 commits February 20, 2023 11:18
This bumps the libs3 dependency declared in CMakeLists so that packages
can be built. Also fixes the build hook to properly install any custom
externals packages supplied to the script.
Adds tests for itouch and istream into the S3 resource plugin. This
tests to make sure that the open/write/close APIs are appropriately
abstracted for dealing with different types of storage, as exposed
through these two iCommands.

These tests are minimal and likely will require expansion in the future.
Adds a test which makes the S3 secret key invalid and attempts an iput.
This ensures that data objects do not get stuck in a locked status even
when the S3 backend can no longer be reached by the S3 resource plugin.

The same test was created for irepl and icp as well.
This checks the irods::error returned by the s3_file_write_operation
function and returns early if something went wrong. If the program is
allowed to continue after a failure in this function, it can lead to a
nullptr dereference later on.

This is a minimal change required to prevent a nullptr dereference from
inside the S3 resource plugin (which causes the servicing agent to
crash). There are other places that need to prevent this kind of
situation from happening, but this is the one instance I know about.
@korydraughn
Copy link
Contributor

Merge when ready.

@alanking alanking merged commit 4720c2a into irods:4-2-stable Feb 20, 2023
@alanking alanking deleted the 6154.42s branch February 20, 2023 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants