You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/09/20 01:55:05 UTC
[GitHub] [incubator-kvrocks] ColinChamber opened a new pull request, #898: Send SIGTERM after finishing the unit test
ColinChamber opened a new pull request, #898:
URL: https://github.com/apache/incubator-kvrocks/pull/898
#893 solved
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] ColinChamber commented on a diff in pull request #898: Send SIGTERM after finishing the unit test
Posted by GitBox <gi...@apache.org>.
ColinChamber commented on code in PR #898:
URL: https://github.com/apache/incubator-kvrocks/pull/898#discussion_r974885499
##########
tests/gocase/util/server.go:
##########
@@ -59,8 +60,13 @@ func (s *KvrocksServer) NewTCPClient() *tcpClient {
}
func (s *KvrocksServer) Close() {
- require.NoError(s.t, s.cmd.Process.Kill())
- require.EqualError(s.t, s.cmd.Wait(), "signal: killed")
+ require.NoError(s.t, s.cmd.Process.Signal(syscall.SIGTERM))
+ // A Pod is granted a term to terminate gracefully, which defaults to 30 seconds.
Review Comment:
Yeah, it is two separate things. I just want the wait time not to be a magic number.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] tisonkun commented on a diff in pull request #898: Send SIGTERM after finishing the unit test
Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #898:
URL: https://github.com/apache/incubator-kvrocks/pull/898#discussion_r974865313
##########
tests/gocase/util/server.go:
##########
@@ -59,8 +60,13 @@ func (s *KvrocksServer) NewTCPClient() *tcpClient {
}
func (s *KvrocksServer) Close() {
- require.NoError(s.t, s.cmd.Process.Kill())
- require.EqualError(s.t, s.cmd.Wait(), "signal: killed")
+ require.NoError(s.t, s.cmd.Process.Signal(syscall.SIGTERM))
+ // A Pod is granted a term to terminate gracefully, which defaults to 30 seconds.
Review Comment:
So here is a local integration test environment. For nothing, we should talk about Kubernetes things?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] ColinChamber commented on a diff in pull request #898: Send SIGTERM after finishing the unit test
Posted by GitBox <gi...@apache.org>.
ColinChamber commented on code in PR #898:
URL: https://github.com/apache/incubator-kvrocks/pull/898#discussion_r974859358
##########
tests/gocase/util/server.go:
##########
@@ -59,8 +60,13 @@ func (s *KvrocksServer) NewTCPClient() *tcpClient {
}
func (s *KvrocksServer) Close() {
- require.NoError(s.t, s.cmd.Process.Kill())
- require.EqualError(s.t, s.cmd.Wait(), "signal: killed")
+ require.NoError(s.t, s.cmd.Process.Signal(syscall.SIGTERM))
+ // A Pod is granted a term to terminate gracefully, which defaults to 30 seconds.
Review Comment:
Kubernetes will send a SIGTERM signal to the containers in the pod after deleting the pod. It waits for a specified time, called the termination grace period. By default, this is 30 seconds. If the containers are still running after the grace period, they are sent the SIGKILL signal and forcibly removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] tisonkun commented on pull request #898: Send SIGTERM after finishing the unit test
Posted by GitBox <gi...@apache.org>.
tisonkun commented on PR #898:
URL: https://github.com/apache/incubator-kvrocks/pull/898#issuecomment-1256975854
Thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] tisonkun commented on a diff in pull request #898: Send SIGTERM after finishing the unit test
Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #898:
URL: https://github.com/apache/incubator-kvrocks/pull/898#discussion_r974854544
##########
tests/gocase/util/server.go:
##########
@@ -59,8 +60,13 @@ func (s *KvrocksServer) NewTCPClient() *tcpClient {
}
func (s *KvrocksServer) Close() {
- require.NoError(s.t, s.cmd.Process.Kill())
- require.EqualError(s.t, s.cmd.Wait(), "signal: killed")
+ require.NoError(s.t, s.cmd.Process.Signal(syscall.SIGTERM))
Review Comment:
I see the `s.cmd.Wait` below so it should be fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] ColinChamber commented on a diff in pull request #898: Send SIGTERM after finishing the unit test
Posted by GitBox <gi...@apache.org>.
ColinChamber commented on code in PR #898:
URL: https://github.com/apache/incubator-kvrocks/pull/898#discussion_r974889699
##########
tests/gocase/util/server.go:
##########
@@ -59,8 +60,13 @@ func (s *KvrocksServer) NewTCPClient() *tcpClient {
}
func (s *KvrocksServer) Close() {
- require.NoError(s.t, s.cmd.Process.Kill())
- require.EqualError(s.t, s.cmd.Wait(), "signal: killed")
+ require.NoError(s.t, s.cmd.Process.Signal(syscall.SIGTERM))
+ // A Pod is granted a term to terminate gracefully, which defaults to 30 seconds.
Review Comment:
Users may want to exit gracefully in 30 seconds, so I change it like this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] tisonkun commented on a diff in pull request #898: Send SIGTERM after finishing the unit test
Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #898:
URL: https://github.com/apache/incubator-kvrocks/pull/898#discussion_r979138787
##########
tests/gocase/util/server.go:
##########
@@ -26,13 +26,16 @@ import (
"os"
"os/exec"
"path/filepath"
+ "syscall"
"testing"
"time"
"github.com/go-redis/redis/v9"
"github.com/stretchr/testify/require"
)
+const k8sDefaultGracePeriod = 30
Review Comment:
Let's move this const to `util/constats.go` and bring the comment to this constant instead of inline.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] PragmaTwice commented on a diff in pull request #898: Send SIGTERM after finishing the unit test
Posted by GitBox <gi...@apache.org>.
PragmaTwice commented on code in PR #898:
URL: https://github.com/apache/incubator-kvrocks/pull/898#discussion_r974852517
##########
tests/gocase/util/server.go:
##########
@@ -59,8 +60,13 @@ func (s *KvrocksServer) NewTCPClient() *tcpClient {
}
func (s *KvrocksServer) Close() {
- require.NoError(s.t, s.cmd.Process.Kill())
- require.EqualError(s.t, s.cmd.Wait(), "signal: killed")
+ require.NoError(s.t, s.cmd.Process.Signal(syscall.SIGTERM))
Review Comment:
I am wondering, if kvrocks crashed, whether it will report an error? cc @tisonkun
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] tisonkun commented on a diff in pull request #898: Send SIGTERM after finishing the unit test
Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #898:
URL: https://github.com/apache/incubator-kvrocks/pull/898#discussion_r974854390
##########
tests/gocase/util/server.go:
##########
@@ -59,8 +60,13 @@ func (s *KvrocksServer) NewTCPClient() *tcpClient {
}
func (s *KvrocksServer) Close() {
- require.NoError(s.t, s.cmd.Process.Kill())
- require.EqualError(s.t, s.cmd.Wait(), "signal: killed")
+ require.NoError(s.t, s.cmd.Process.Signal(syscall.SIGTERM))
+ // A Pod is granted a term to terminate gracefully, which defaults to 30 seconds.
Review Comment:
What does `Pod` stand for here? It seems a comment copied from somewhere that doesn't fit this situation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] ColinChamber commented on a diff in pull request #898: Send SIGTERM after finishing the unit test
Posted by GitBox <gi...@apache.org>.
ColinChamber commented on code in PR #898:
URL: https://github.com/apache/incubator-kvrocks/pull/898#discussion_r979207477
##########
tests/gocase/util/server.go:
##########
@@ -26,13 +26,16 @@ import (
"os"
"os/exec"
"path/filepath"
+ "syscall"
"testing"
"time"
"github.com/go-redis/redis/v9"
"github.com/stretchr/testify/require"
)
+const k8sDefaultGracePeriod = 30
Review Comment:
OK. Thanks for your help!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] tisonkun merged pull request #898: Send SIGTERM after finishing the unit test
Posted by GitBox <gi...@apache.org>.
tisonkun merged PR #898:
URL: https://github.com/apache/incubator-kvrocks/pull/898
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org