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

Feature/redrive on buffer too small error #79

Closed
wants to merge 17 commits into from

Conversation

ElijahSwiftIBM
Copy link
Collaborator

💡 Issue Reference

Issue: #71

💻 What does this address?

Now that users can specify buffer sizes as a part of the class constructor, we need to dynamically respond to the buffer size being too small to hold the response xml.

📟 Implementation Details

At the C code level, if the failing request is detected, a new buffer is allocated large enough for the remaining response and the request is re-driven. If the buffer would need to be larger than the maximum tolerable size for our constructor, we fail and surface the error as a DownstreamFatalError with IRRSMO00's return and reason codes.

📋 Is there a test case?

Since this re-drive is done at the c level, there are no applicable unit tests available. A function test could be added, but we would need confirmation that the environment is appropriate for the test (a command and buffer size must be chosen that we KNOW would fail prior to this feature which may differ dependent on the environment and authority bestowed to pyRACF).

On our test system, I ran two tests. One with setropts_admin.list_racf_options with a buffer specified at 10000 bytes (the minimum) which failed before the added code and now succeeds, and one with resource_admin.extract("*","FACILITY) with the default 16KB buffer which failed and now succeeds.

-Make Length parameters implicitly grab length from passed strings/arrays
-Re-structure response from pyRACF as dictionary rather than tuple
-Add handle pointer to the returned dictionary

Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
update C code to re-drive requests with dynamically adjusted buffer size.
remove passing of handle pointer to python
LOTS OF DEBUGGING

Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
Update version number

Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
Remove accounting for previously allocated buffer space. Since only 1 command comes to SMO00, this should only practically be the XML header returned on the first call (116 bytes or so).

Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
@ElijahSwiftIBM ElijahSwiftIBM changed the base branch from main to dev February 20, 2024 15:55
@ElijahSwiftIBM ElijahSwiftIBM force-pushed the feature/redrive_on_buffer_too_small_error branch 4 times, most recently from 7169696 to 28b2c29 Compare February 29, 2024 18:46
Move Re-driving requests from c code to python

Move redriving requests from c layer to python layer

drop the initial results buffer as this is no longer doing anything.

debug prints

Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
@ElijahSwiftIBM ElijahSwiftIBM force-pushed the feature/redrive_on_buffer_too_small_error branch from 59294cc to 14ce1e5 Compare February 29, 2024 18:57
This reverts commit 14ce1e5.
Test different return code locations at c layer

Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
Try making new handle
Test different return code locations at c layer

Signed-off-by: Elijah Swift <elijah.swift@ibm.com>

Update irrsmo00.c

Try making new handle

Update irrsmo00.c
This reverts commit 14ce1e5.
Try passing the handle through c and python

Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
Fixed error in handling test_irrsmo00_interface with returned handle
@ElijahSwiftIBM ElijahSwiftIBM force-pushed the feature/redrive_on_buffer_too_small_error branch from 92c0cb9 to 16e7d23 Compare February 29, 2024 20:09
Update irrsmo00.c
@ElijahSwiftIBM ElijahSwiftIBM force-pushed the feature/redrive_on_buffer_too_small_error branch from 16e7d23 to 811b1b2 Compare February 29, 2024 21:27
@ElijahSwiftIBM
Copy link
Collaborator Author

Closing this PR as we are re-assessing these features. This will either get moved to python layer or involve new unit testing in C layer.

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.

1 participant