-
Notifications
You must be signed in to change notification settings - Fork 16
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
Issue 2205 - 4-3-stable #2208
Conversation
7218049
to
85f89ae
Compare
s3_resource/include/irods/private/s3_resource/multipart_shared_data.hpp
Outdated
Show resolved
Hide resolved
s3_resource/include/irods/private/s3_resource/multipart_shared_data.hpp
Outdated
Show resolved
Hide resolved
s3_resource/include/irods/private/s3_resource/multipart_shared_data.hpp
Outdated
Show resolved
Hide resolved
s3_transport/include/irods/private/s3_transport/managed_shared_memory_object.hpp
Outdated
Show resolved
Hide resolved
f831fbc
to
775e26f
Compare
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.
Changes look good.
If the tests pass, squash to taste.
538f757
to
46b5905
Compare
Done |
One of your commits includes "#". Let's replace that with "number" so there's no confusion. |
46b5905
to
a03a62f
Compare
done |
If you're happy with it, pound it. |
a03a62f
to
19a7c86
Compare
done |
Merging. |
@JustinKyleJames Now, we need to cherry-pick to the main branch, correct? |
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'satomic_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.