-
Notifications
You must be signed in to change notification settings - Fork 181
Refactor client utilities and add experiment heartbeat #1401
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
Conversation
Moved client utility functions and models to a new utils.py file, including the safe_request decorator. Introduced a client heartbeat mechanism to keep experiments active, with integration in CloudPyCallback. Updated imports and improved type hinting for better maintainability.
Summary of ChangesHello @SAKURA-CAT, 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 introduces a crucial client-side heartbeat feature to ensure the continuous active status of experiments, addressing issues where experiments might be incorrectly closed due to prolonged periods without log uploads or during resume operations. Concurrently, it refactors core client utilities by centralizing error handling and model definitions, improving code organization and maintainability. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
|
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
这个拉取请求引入了心跳机制来保持实验的活跃状态,这是一个很好的补充,可以防止实验过早终止。将客户端工具函数重构到单独的 utils.py 文件中也改善了代码的组织结构。我有一些建议可以提高代码质量和健壮性。具体来说,我建议避免使用通配符导入以提高清晰度,使用 f-string 进行日志记录,并添加空值检查以防止在停止心跳时出现潜在的运行时错误。
Added an interval parameter to create_client_heartbeat for configurable heartbeat timing. Improved CloudPyCallback.on_stop to check for heartbeat existence before canceling and joining, preventing potential errors.
Corrected a typo in a comment to improve clarity and maintain code quality. No functional changes were made.
添加客户端心跳,以解决resume等场景下过久未上传日志,错误关闭实验的问题
closes: #1255