Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

client hung when the open files reach limit #1248

Closed
HarrisChu opened this issue Jul 13, 2021 · 1 comment
Closed

client hung when the open files reach limit #1248

HarrisChu opened this issue Jul 13, 2021 · 1 comment

Comments

@HarrisChu
Copy link
Contributor

# in graph server
ulimit -n 400
scripts/nebula.service start graphd
# in client
# create a pool and then initial session in loop, e.g.

func main() {
	hostAddress := nebula.HostAddress{Host: address, Port: port}
	hostList := []nebula.HostAddress{hostAddress}
	testPoolConfig := nebula.GetDefaultConf()
	testPoolConfig.MaxConnPoolSize = 100

	pool, err := nebula.NewConnectionPool(hostList, testPoolConfig, log)
	if err != nil {
		log.Fatal(fmt.Sprintf("Fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()))
	}
	defer pool.Close()
	for i := 0; i < testPoolConfig.MaxConnPoolSize; i++ {
		log.Info(fmt.Sprintf("begin get session %d", i))
		session, err := pool.GetSession(username, password)
		if err != nil {
			log.Fatal(fmt.Sprintf("Fail to create a new session from connection pool, username: %s, password: %s, %s",
				username, password, err.Error()))

		}
		session.Execute("USE SF1")
	}
}

client would hung up forever, and the sever log as below:

E0713 22:18:30.224404 38653 AsyncServerSocket.cpp:961] accept failed: out of file descriptors; entering accept back-off state
E0713 22:18:30.224467 38521 Acceptor.cpp:396] error accepting on acceptor socket: accept() failed
E0713 22:18:31.225469 38653 AsyncServerSocket.cpp:961] accept failed: out of file descriptors; entering accept back-off state
E0713 22:18:31.225526 38522 Acceptor.cpp:396] error accepting on acceptor socket: accept() failed

I think we should return error if cannot make connections.

@HarrisChu
Copy link
Contributor Author

just as a known issue, client set timeout configuration would raise error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant