Skip to content

refactor/fix post unmarshal#801

Merged
joe-chacko merged 3 commits into
OpenLiberty:mainfrom
ngmr:refactor/fix-post-unmarshal
Jun 5, 2026
Merged

refactor/fix post unmarshal#801
joe-chacko merged 3 commits into
OpenLiberty:mainfrom
ngmr:refactor/fix-post-unmarshal

Conversation

@ngmr

@ngmr ngmr commented Jun 5, 2026

Copy link
Copy Markdown
Member
  • refactor(yoko-core): defer portable interceptor invocation until first read
  • refactor(interceptors): add post_marshal interception point for thread-local cleanup
  • refactor(util): consolidate thread-local handling with unified stack pattern

@ngmr ngmr self-assigned this Jun 5, 2026
@ngmr ngmr requested a review from joe-chacko June 5, 2026 01:11
@ngmr ngmr force-pushed the refactor/fix-post-unmarshal branch 2 times, most recently from 587ad6e to 326a412 Compare June 5, 2026 09:06
ngmr and others added 2 commits June 5, 2026 13:08
…t read

- Changed DowncallStub.invoke() to return WrappedReplyInputStream instead of calling postUnmarshal() immediately
- Created WrappedReplyInputStream wrapper that intercepts first read operation to trigger interceptors
- Ensures interceptors are called AFTER stub unmarshals first value, making result available to interceptors
- Properly reports unmarshalling exceptions via receive_exception interception point
- Updated CmsfTest, RoflTest, and YasfTest to reflect new behavior where thread-local options are set during unmarshalling
- Lines added: 192, lines removed: 24

Co-authored-by: Joe Chacko <chackoj@uk.ibm.com>
Co-authored-by-AI: IBM Bob 1.0.4
…d-local cleanup

- Added ExtendedServerRequestInterceptor.post_marshal() method to clean up thread-local state after response marshalling
- Added default implementations for all ExtendedServerRequestInterceptor methods to reduce boilerplate
- Updated PIManager.serverPostMarshal() to invoke post_marshal on extended interceptors
- Modified PIUpcall.postMarshal() to call piManager_.serverPostMarshal() before super.postMarshal()
- Updated ServerRequestInfo_impl._OB_postMarshal() to call post_marshal on extended interceptors with CMSF/YASF override context
- Refactored YasfServerInterceptor to use post_marshal for cleanup instead of send_reply/send_exception/send_other
- Refactored RoflServerInterceptor to use post_marshal for cleanup instead of send_reply/send_exception/send_other
- Refactored CmsfServerInterceptor to use post_marshal for cleanup instead of setupCmsfThreadLocalValue in send methods
- Modernized ThreadLocal initialization in CmsfThreadLocal and YasfThreadLocal to use withInitial()
- Fixed YasfTest.Echo interface visibility to public
- Substantive lines added: 152, lines removed: 65

This fixes the YasfTest failure where YASF thread-local state was not properly
available during serialization. The new post_marshal interception point ensures
thread-local state is cleaned up after marshalling completes, matching the
lifecycle established by pre_unmarshal for setup after context switches.

Co-authored-by-AI: IBM Bob 1.0.4
@ngmr ngmr force-pushed the refactor/fix-post-unmarshal branch from 326a412 to 9dce32a Compare June 5, 2026 12:12
…pattern

- Introduced ThreadLocalStack utility class to replace individual ThreadLocal implementations
- Removed CmsfThreadLocal, RoflThreadLocal, and YasfThreadLocal in favor of unified ThreadLocalStack approach
- Introduced InfoWrangler base class for reading and writing various info types
- Created specialized wranglers (CmsfWrangler, YasfWrangler) for managing protocol-specific operations
- Deleted CmsfVersion and YasfHelper classes, consolidating functionality into wranglers
- Updated all interceptors (CMSF, ROFL, YASF) to use new wrangler pattern with ThreadLocalStack
- Modified RMI ObjectWriter and FieldDescriptor to integrate with new thread-local management
- Updated ServerRequestInfo_impl and ClientRequestInfo_impl to use YASF_THREAD_LOCAL and CMSF_THREAD_LOCAL constants
- Enhanced OrbSteward in testify-iiop to support new pattern
- Updated all related tests to use new API
- Substantive lines added: 722, lines removed: 774

Co-authored-by-AI: IBM Bob 1.0.4
@ngmr ngmr force-pushed the refactor/fix-post-unmarshal branch from 9dce32a to 97f2476 Compare June 5, 2026 15:58

@joe-chacko joe-chacko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like what you've done here…

@joe-chacko joe-chacko merged commit 018ac21 into OpenLiberty:main Jun 5, 2026
2 checks passed
@ngmr ngmr deleted the refactor/fix-post-unmarshal branch June 5, 2026 16:20
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.

2 participants