-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: sync gRPC Streaming Graceful Shutdown (#1190)
Co-authored-by: yuxuan.wang1 <[email protected]>
- Loading branch information
1 parent
644fef0
commit 43c1941
Showing
10 changed files
with
76 additions
and
22 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
content/en/docs/kitex/Tutorials/basic-feature/protocol/streaming/_index.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: "Streaming" | ||
linkTitle: "Streaming" | ||
weight: 2 | ||
date: 2024-01-13 | ||
description: > | ||
--- |
7 changes: 7 additions & 0 deletions
7
content/en/docs/kitex/Tutorials/basic-feature/protocol/streaming/gRPC/_index.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: "gRPC" | ||
linkTitle: "gRPC" | ||
weight: 2 | ||
date: 2024-01-13 | ||
description: > | ||
--- |
40 changes: 40 additions & 0 deletions
40
...docs/kitex/Tutorials/basic-feature/protocol/streaming/gRPC/graceful_shutdown.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: "gRPC Streaming Graceful Shutdown" | ||
date: 2025-01-13 | ||
weight: 4 | ||
keywords: ["gRPC Streaming Graceful Shutdown"] | ||
description: "This article describes how to use Graceful Shutdown over gRPC" | ||
--- | ||
|
||
## Background | ||
|
||
To effectively solve the problem of upstream error reporting caused by service upgrade/migration, Kitex supports the graceful shutdown function of gRPC Streaming in the new version (v0.12.0). | ||
|
||
By setting a reasonable window time, the streams with a lifetime shorter than this window can continue to work until the end, while the streams with a lifetime longer than this window will be forcibly closed. | ||
|
||
## Usage | ||
|
||
### Confirm the window time | ||
|
||
Before starting the configuration, please obtain the duration distribution of the streams in the current service based on business statistics, and thereby establish a reasonable window time, denoted as **graceTime**, for example: | ||
|
||
- All streams can be completed within 5 minutes, and 5 minutes is an acceptable service upgrade time, then **graceTime** is 5 minutes. | ||
- Most streams can be completed within 5 minutes, and very few streams will last for 30 minutes, then **graceTime** can still be set to 5 minutes, and the flows exceeding graceTime will be forcibly closed. | ||
|
||
### Configuration | ||
|
||
When creating the Server, pass `server.WithExitWaitTime(graceTime)`. | ||
|
||
If not configured, the default is **5 s**. | ||
|
||
```go | ||
import ( | ||
"github.com/cloudwego/kitex/server" | ||
) | ||
|
||
const ( | ||
graceTime = 600 * time.Second | ||
) | ||
|
||
svr := testservice.NewServer(hdl, server.WithExitWaitTime(graceTime)) | ||
``` |
8 changes: 4 additions & 4 deletions
8
...l/transport-streaming/thrift_streaming.md → ...otocol/streaming/gRPC/thrift_streaming.md
This file contains 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
7 changes: 0 additions & 7 deletions
7
...nt/en/docs/kitex/Tutorials/basic-feature/protocol/transport-streaming/_index.md
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
content/zh/docs/kitex/Tutorials/basic-feature/protocol/streaming/_index.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: "Streaming" | ||
linkTitle: "Streaming" | ||
weight: 2 | ||
date: 2024-03-06 | ||
description: > | ||
--- |
7 changes: 7 additions & 0 deletions
7
content/zh/docs/kitex/Tutorials/basic-feature/protocol/streaming/gRPC/_index.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: "gRPC" | ||
linkTitle: "gRPC" | ||
weight: 2 | ||
date: 2025-01-13 | ||
description: > | ||
--- |
2 changes: 1 addition & 1 deletion
2
.../transport-streaming/graceful_shutdown.md → ...tocol/streaming/gRPC/graceful_shutdown.md
This file contains 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
6 changes: 3 additions & 3 deletions
6
...l/transport-streaming/thrift_streaming.md → ...otocol/streaming/gRPC/thrift_streaming.md
This file contains 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
7 changes: 0 additions & 7 deletions
7
...nt/zh/docs/kitex/Tutorials/basic-feature/protocol/transport-streaming/_index.md
This file was deleted.
Oops, something went wrong.