-
Notifications
You must be signed in to change notification settings - Fork 38
api: add session lifecycle callbacks and tests #286
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @rgerhards, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the RELP engine's extensibility by exposing new API callbacks for server session lifecycle events. Developers can now register functions to be notified when a RELP session successfully opens, fails to open, or closes for any reason. This provides crucial hooks for monitoring, resource management, and custom logic tied to the state of individual RELP connections, improving the overall observability and integration capabilities of the RELP library. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
/gemini review |
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.
Code Review
This pull request introduces session lifecycle callbacks (open, close, and open-fail) to the RELP engine, enhancing its extensibility and observability. The changes include adding callback function pointers to the relpEngine_s structure, defining corresponding setter functions in librelp.h and relp.c, and integrating the callback invocations at the appropriate points in the session management logic. Notably, the relpEngineDelSess function has been updated to accept a reason parameter, ensuring that session close callbacks provide context for termination. Comprehensive test cases have been added, including a new Python script to simulate an invalid open handshake and a shell script to orchestrate the testing of all new callbacks. The documentation for the new API functions is clear and detailed. Overall, the implementation is robust and well-tested, providing valuable new functionality without introducing any apparent issues.
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.
Code Review
This pull request introduces session lifecycle callbacks (onSessOpen, onSessClose, onSessOpenFail), allowing applications to be notified of session state changes. The changes are well-implemented, with clear documentation for the new API in librelp.h and corresponding logic in copen.c and relp.c. The refactoring to use relpEngineDelSess during engine destruction is a good improvement for consistency and ensures callbacks are fired. The accompanying tests in tests/session-callbacks.sh and tests/invalid-open.py are comprehensive and cover both success and failure scenarios. I've only found a couple of minor indentation issues in src/relp.c which I've commented on. Overall, this is a great addition to the library.
Expose open/close/open-failed callbacks for server sessions. Document callback semantics in librelp headers. Emit close callbacks on engine teardown. Extend test receiver plus add session-callback test harness.
Expose open/close/open-failed callbacks for server sessions.
Document callback semantics in librelp headers.
Emit close callbacks on engine teardown.
Extend test receiver plus add session-callback test harness.