feat(pftools): enhance function failure handling with retry logic#79
Merged
feat(pftools): enhance function failure handling with retry logic#79
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the Pulsar Function Manager's error handling by adding retry logic and failure categorization. It introduces a failure cache to track function conversion failures, classifies them as permanent, retryable, or unknown, and implements smart retry behavior to avoid excessive logging and retry attempts for permanent failures.
Changes:
- Added failure state tracking with configurable retry intervals based on failure classification
- Introduced error categorization to distinguish between permanent failures (e.g., no input topics, schema conversion errors) and retryable failures (e.g., network errors, auth errors)
- Enhanced schema fetch error handling to preserve error information for better classification
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/mcp/pftools/types.go | Adds failedFunctions map to track failure states, SchemaFetchError field to preserve schema fetch errors, and defines failure categories and state structure |
| pkg/mcp/pftools/manager_failure_cache_test.go | Provides unit tests for failure skip and logging decision logic |
| pkg/mcp/pftools/manager.go | Implements failure caching logic in updateFunctions(), adds helper functions for hash computation and failure decision-making, and enhances error handling in function conversion |
| pkg/mcp/pftools/errors.go | Introduces new sentinel errors and classifyConvertError() function to categorize failures |
| pkg/mcp/pftools/errors_test.go | Adds test coverage for error classification logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jiangpengcheng
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.