Repository navigation
fix: catch discard error and return - #204
ningmingxiao wants to merge 1 commit into
Conversation
6976588 to
be12196
Compare
|
Sorry for the late reply. I've updated GitHub Actions. Can you rebase this PR against main? |
be12196 to
fe96bdd
Compare
|
done thanks @kzys |
|
Did you confirm this fixed the issue? Looking through the bufio implementation of |
fe96bdd to
e3b5a07
Compare
|
you are right I create new pr will fix. @dmcgowan |
2f33066 to
72984df
Compare
|
Catching any error on discard makes sense and exiting. If the discard did not succeed then the connection must be ended as it is no longer in a processable state. |
72984df to
c12e5ff
Compare
|
done thanks @dmcgowan |
c12e5ff to
847da32
Compare
Retr0-XD
left a comment
There was a problem hiding this comment.
LGTM. The discard failure should be terminal so the recv loop exits. Once this merges, containerd/containerd#13085 can vendor the fix cleanly.
thaJeztah
left a comment
There was a problem hiding this comment.
left some comments on the implementation and formatting of the error
| type DiscardErr struct { | ||
| err error | ||
| } |
There was a problem hiding this comment.
Looks like this error-type is only intended to be asserted internally, and not by users of this module; if that's the case, we should un-export it.
This can also be simplified by embedding error, then no constructor is needed, and no Error() method;
type discardError struct {
error
}Probably not necessary (because of how it's used), but optionally;
func (e *discardError) Unwrap() error { return e.error }Then used as;
return mh, nil, &discardError{fmt.Errorf("failed to discard after receiving oversized message: %w; message length %v, maximum message size %v", err, mh.Length, messageLengthMax)}96fd3b9 to
941e3a7
Compare
|
ci failed because other reason |
|
ping @thaJeztah |
941e3a7 to
9d73d15
Compare
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
9d73d15 to
5733753
Compare
|
@thaJeztah done ci already passed |
|
ping @thaJeztah can you take a look? thanks |
to fix containerd/containerd#12669 @fuweid @dmcgowan