-
Notifications
You must be signed in to change notification settings - Fork 112
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
feat: enable edge-level kill switch to drop messages when buffer is full, for the non-reduce forwarder #634
Changes from 1 commit
87bd771
dcea97f
37abe9b
d2d6e26
d576b49
a0e33e4
fd006d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Signed-off-by: Keran Yang <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,7 @@ import ( | |
"k8s.io/apimachinery/pkg/api/resource" | ||
) | ||
|
||
// OnFullWritingStrategy is an edge-level specification to define the writing behaviour when the ToBuffer is full | ||
type OnFullWritingStrategy string | ||
type BufferFullWritingStrategy string | ||
|
||
const ( | ||
Project = "numaflow" | ||
|
@@ -125,9 +124,8 @@ const ( | |
DefaultBufferUsageLimit = 0.8 | ||
DefaultReadBatchSize = 500 | ||
|
||
// Edge-level specification to define the writing behaviour when the ToBuffer is full | ||
RetryUntilSuccess OnFullWritingStrategy = "retryUntilSuccess" | ||
DiscardLatest OnFullWritingStrategy = "discardLatest" | ||
RetryUntilSuccess BufferFullWritingStrategy = "retryUntilSuccess" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move these as well? |
||
DiscardLatest BufferFullWritingStrategy = "discardLatest" | ||
|
||
// Auto scaling | ||
DefaultLookbackSeconds = 180 // Default lookback seconds for calculating avg rate and pending | ||
|
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ package forward | |
|
||
import ( | ||
"context" | ||
"errors" | ||
"fmt" | ||
"math" | ||
"sync" | ||
|
@@ -490,7 +491,7 @@ func (isdf *InterStepDataForward) writeToBuffer(ctx context.Context, toBuffer is | |
for idx, msg := range messages { | ||
if err := errs[idx]; err != nil { | ||
// ATM there are no user defined errors during write, all are InternalErrors. | ||
if _, ok := err.(isb.NoRetryableBufferWriteErr); ok { | ||
if ok := errors.As(err, &isb.NoRetryableBufferWriteErr{}); ok { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor - removing |
||
// If toBuffer returns us a NoRetryableBufferWriteErr, we drop the message. | ||
dropBytes += float64(len(msg.Payload)) | ||
} else { | ||
|
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.
Move to edge_types.go?