Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
bcc014eb
Commit
bcc014eb
authored
Jun 6, 2020
by
william feng
Browse files
Options
Downloads
Patches
Plain Diff
fixed minor grammar issues
parent
8e187475
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/extension/auth.go
+1
-1
1 addition, 1 deletion
common/extension/auth.go
filter/filter_impl/graceful_shutdown_filter.go
+2
-2
2 additions, 2 deletions
filter/filter_impl/graceful_shutdown_filter.go
with
3 additions
and
3 deletions
common/extension/auth.go
+
1
−
1
View file @
bcc014eb
...
@@ -32,7 +32,7 @@ func SetAuthenticator(name string, fcn func() filter.Authenticator) {
...
@@ -32,7 +32,7 @@ func SetAuthenticator(name string, fcn func() filter.Authenticator) {
}
}
// GetAuthenticator finds the Authenticator with @name
// GetAuthenticator finds the Authenticator with @name
//
p
anic if not found
//
P
anic if not found
func
GetAuthenticator
(
name
string
)
filter
.
Authenticator
{
func
GetAuthenticator
(
name
string
)
filter
.
Authenticator
{
if
authenticators
[
name
]
==
nil
{
if
authenticators
[
name
]
==
nil
{
panic
(
"authenticator for "
+
name
+
" is not existing, make sure you have import the package."
)
panic
(
"authenticator for "
+
name
+
" is not existing, make sure you have import the package."
)
...
...
This diff is collapsed.
Click to expand it.
filter/filter_impl/graceful_shutdown_filter.go
+
2
−
2
View file @
bcc014eb
...
@@ -53,7 +53,7 @@ type gracefulShutdownFilter struct {
...
@@ -53,7 +53,7 @@ type gracefulShutdownFilter struct {
shutdownConfig
*
config
.
ShutdownConfig
shutdownConfig
*
config
.
ShutdownConfig
}
}
// Invoke add the requests count and block the new requests if application is closing
// Invoke add
s
the requests count and block the new requests if application is closing
func
(
gf
*
gracefulShutdownFilter
)
Invoke
(
ctx
context
.
Context
,
invoker
protocol
.
Invoker
,
invocation
protocol
.
Invocation
)
protocol
.
Result
{
func
(
gf
*
gracefulShutdownFilter
)
Invoke
(
ctx
context
.
Context
,
invoker
protocol
.
Invoker
,
invocation
protocol
.
Invocation
)
protocol
.
Result
{
if
gf
.
rejectNewRequest
()
{
if
gf
.
rejectNewRequest
()
{
logger
.
Info
(
"The application is closing, new request will be rejected."
)
logger
.
Info
(
"The application is closing, new request will be rejected."
)
...
@@ -63,7 +63,7 @@ func (gf *gracefulShutdownFilter) Invoke(ctx context.Context, invoker protocol.I
...
@@ -63,7 +63,7 @@ func (gf *gracefulShutdownFilter) Invoke(ctx context.Context, invoker protocol.I
return
invoker
.
Invoke
(
ctx
,
invocation
)
return
invoker
.
Invoke
(
ctx
,
invocation
)
}
}
// OnResponse reduce the number of active processes then return the process result
// OnResponse reduce
s
the number of active processes then return the process result
func
(
gf
*
gracefulShutdownFilter
)
OnResponse
(
ctx
context
.
Context
,
result
protocol
.
Result
,
invoker
protocol
.
Invoker
,
invocation
protocol
.
Invocation
)
protocol
.
Result
{
func
(
gf
*
gracefulShutdownFilter
)
OnResponse
(
ctx
context
.
Context
,
result
protocol
.
Result
,
invoker
protocol
.
Invoker
,
invocation
protocol
.
Invocation
)
protocol
.
Result
{
atomic
.
AddInt32
(
&
gf
.
activeCount
,
-
1
)
atomic
.
AddInt32
(
&
gf
.
activeCount
,
-
1
)
// although this isn't thread safe, it won't be a problem if the gf.rejectNewRequest() is true.
// although this isn't thread safe, it won't be a problem if the gf.rejectNewRequest() is true.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment