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

Issue 2205 - 4-3-stable #2208

Merged
merged 2 commits into from
Jul 11, 2024
Merged

Conversation

JustinKyleJames
Copy link
Contributor

@JustinKyleJames JustinKyleJames commented Jul 10, 2024

This pull request addresses two issues:

#2205 - For uploads the number of upload threads must be known. For PRC transfers with multiprocess uploads, only the first process is setting the keyword for the number of threads. Since these are multiple processes, this information needs to be saved in multiprocess shared memory so other processes know the correct number of transfer threads/processes.

I created a new shared data segment for the s3 resource which is separate from the s3 transport's shared memory. I renamed the transport's shared memory so that it is clear which is which.

To know when shared memory can be cleaned up, a counter was added to track the number of closes. Once the close counter reaches the number of threads the shared memory is cleaned up. I have verified that when running the test suite all shared memory files are cleaned up as expected.

Note that an up/down counter tracking create/open and closes will not work as the shared memory must be created before the first create/open and with an up/down counter this counter would immediately be zero and the shared memory would be deleted.

Read operations do not need this shared memory as we don't need to know the number of threads/processes in that case. In addition, the number of threads is not reliable in that scenario so it would be difficult to determine when the shared memory can be cleaned up.

I also learned via testing that our mechanism to calculate the necessary shared memory sizes is not accurate as the boost libraries need an unspecified amount of overhead memory. It was suggested that 100*sizeof(void*) bytes is plenty for this so I added this extra into both the new shared memory and the existing transport's shared memory.

Finally, I wrapped most of the get_number_of_threads_data_size_and_opr_type() processing within the shared memory's atomic_exec() as it simplifies everything if this part of the code is atomically executed. A lot of the changes below are simply a result of changing the indentation because of this.

#2207 - I updated the code to use the test case name in filenames that are created.

Tests passed.

s3_resource/src/s3_operations.cpp Outdated Show resolved Hide resolved
s3_resource/src/s3_operations.cpp Outdated Show resolved Hide resolved
s3_resource/src/s3_operations.cpp Outdated Show resolved Hide resolved
s3_resource/src/s3_operations.cpp Outdated Show resolved Hide resolved
s3_transport/include/irods/private/s3_transport/util.hpp Outdated Show resolved Hide resolved
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.

If the tests pass, squash to taste.

@JustinKyleJames
Copy link
Contributor Author

Changes look good.

If the tests pass, squash to taste.

Done

@korydraughn
Copy link
Contributor

One of your commits includes "#". Let's replace that with "number" so there's no confusion.

@JustinKyleJames
Copy link
Contributor Author

One of your commits includes "#". Let's replace that with "number" so there's no confusion.

done

@korydraughn
Copy link
Contributor

If you're happy with it, pound it.

@JustinKyleJames
Copy link
Contributor Author

If you're happy with it, pound it.

done

@korydraughn
Copy link
Contributor

Merging.

@korydraughn korydraughn merged commit e539cf1 into irods:4-3-stable Jul 11, 2024
0 of 2 checks passed
@korydraughn
Copy link
Contributor

@JustinKyleJames Now, we need to cherry-pick to the main branch, correct?

@JustinKyleJames JustinKyleJames deleted the issue_2205 branch July 12, 2024 14:22
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.

2 participants