Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Judge add rpc timeout #251

Merged
merged 4 commits into from
Apr 30, 2019
Merged

Conversation

qlyzpqz
Copy link
Contributor

@qlyzpqz qlyzpqz commented Sep 18, 2017

open-falcon-archive/judge#6

为了解决这个issure的问题,给RPC调用增加了一个超时方法,可以将hbs改用一个fake_server来进行测试

package main

import (
	"log"
	"net"
	"time"
)

func serve(conn *net.Conn) {

	time.Sleep(time.Duration(1000) * time.Second)
}

func main() {

	listener, err := net.Listen("tcp", "0.0.0.0:6030")
	if err != nil {

		log.Println("[ERROR] listen on :6030 failed,", err)
		return
	}
	for {

		conn, err := listener.Accept()
		if err != nil {

			log.Println("[ERROR] accept an new connection failed,", err)
			break
		}
		go serve(&conn)
	}
}

@laiwei laiwei merged commit 3c6bf5c into open-falcon:master Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants