Skip to content

Commit

Permalink
codegen: Limit SDKs API payload ignoring trait to unmodeled request i…
Browse files Browse the repository at this point in the history
…nputs (#4139)

Updates the SDK's protocol serialization code generation to only ignore
request API payloads for operations without modeled payload input
parameters. The SDKs protocol deserializers did not correctly handle
this value and caused unexpected close_wait states on the HTTP
connection because the response body was not drained.
  • Loading branch information
jasdel committed Oct 20, 2021
1 parent b0b6524 commit 0cb329a
Show file tree
Hide file tree
Showing 122 changed files with 1,068 additions and 1,066 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Expand Up @@ -3,3 +3,5 @@
### SDK Enhancements

### SDK Bugs
* `codegen`: Fix SDK not draining HTTP response body for operations without modeled output parameters.
* Fixes a bug in the SDK that was causing HTTP response bodies to not be drained, preventing the connection being reused in the connection pool. For some operations this could contributed to an increase in `close_wait` connection states.
4 changes: 2 additions & 2 deletions private/model/api/codegentest/service/restjsonservice/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion private/model/api/shape.go
Expand Up @@ -535,7 +535,7 @@ func (ref *ShapeRef) GoTags(toplevel bool, isRequired bool) string {
if name := ref.Shape.PayloadRefName(); len(name) > 0 {
tags = append(tags, ShapeTag{"payload", name})
}
if !ref.Shape.HasPayloadMembers() && ref.API.Metadata.Protocol == "rest-json" {
if ref.Shape.UsedAsInput && !ref.Shape.HasPayloadMembers() && ref.API.Metadata.Protocol == "rest-json" {
tags = append(tags, ShapeTag{"nopayload", "true"})
}
}
Expand Down

0 comments on commit 0cb329a

Please sign in to comment.