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

[BUG] - Netpoll related issue #830

Closed
sujit-baniya opened this issue Jun 23, 2023 · 14 comments
Closed

[BUG] - Netpoll related issue #830

sujit-baniya opened this issue Jun 23, 2023 · 14 comments
Labels
question Further information is requested

Comments

@sujit-baniya
Copy link

I am using Netpoll transporter for hertz. At some point I received following issue:

NETPOLL: readall(fd=14) before close: EOF

@github-actions github-actions bot added the invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) label Jun 23, 2023
@li-jin-gou li-jin-gou added question Further information is requested and removed invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) labels Jun 23, 2023
@li-jin-gou
Copy link
Member

Can you provide a replicated example? As a rule of thumb, this error is caused when the connection is closed while the client is transferring data.

@sujit-baniya
Copy link
Author

sujit-baniya commented Jun 25, 2023

@li-jin-gou I cannot replicate the issue with code changes. Whenever there's long running application even if there's no any requests, I did receive this error on console.

I just used the hello world example using NETPOLL

/*
 * Copyright 2022 CloudWeGo Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package main

import (
	"context"
	"fmt"

	"github.com/cloudwego/hertz/pkg/app"
	"github.com/cloudwego/hertz/pkg/app/server"
	"github.com/cloudwego/hertz/pkg/common/utils"
	"github.com/cloudwego/hertz/pkg/protocol/consts"
)

type Test struct {
	A string
	B string
}

func main() {
	h := server.Default(server.WithTransport(netpoll.NewTransporter))
	h.StaticFS("/", &app.FS{Root: "./", GenerateIndexPages: true})

	h.GET("/ping", func(c context.Context, ctx *app.RequestContext) {
		ctx.JSON(consts.StatusOK, utils.H{"ping": "pong"})
	})

	h.GET("/json", func(c context.Context, ctx *app.RequestContext) {
		ctx.JSON(consts.StatusOK, &Test{
			A: "aaa",
			B: "bbb",
		})
	})

	h.GET("/redirect", func(c context.Context, ctx *app.RequestContext) {
		ctx.Redirect(consts.StatusMovedPermanently, []byte("http://www.google.com/"))
	})

	v1 := h.Group("/v1")
	{
		v1.GET("/hello/:name", func(c context.Context, ctx *app.RequestContext) {
			fmt.Fprintf(ctx, "Hi %s, this is the response from Hertz.\n", ctx.Param("name"))
		})
	}

	h.Spin()
}

@li-jin-gou
Copy link
Member

cc @joway Need your help.

@sujit-baniya
Copy link
Author

FYI, same error again:

2023/06/27 11:43:47 NETPOLL: readall(fd=15) before close: EOF

Not sure what might be causing this issue

@joway
Copy link
Member

joway commented Jun 30, 2023

@sujit-baniya I run your code about 3 hours.... cannot reproduce your problem...

But anyway, the error could be ignore if there is no actual request eror.

@joway
Copy link
Member

joway commented Jun 30, 2023

Whenever there's long running application even if there's no any requests, I did receive this error on console.

what's long means? is 3 hours enougth?

@sujit-baniya
Copy link
Author

@joway It' not certain if the error occurs at certain duration of time.
Today I've not received any error for last 12hrs.

So i'm not sure what might have caused the issue. Maybe you could point out some pointers to me to try out?

@joway
Copy link
Member

joway commented Jul 3, 2023

@sujit-baniya I run the problem you give 3 days and no errors occur. Most it because your enviroment have some unexcept connection. The log just point out a warning and could be ignore if you dont have real problem.

@sujit-baniya
Copy link
Author

@joway Thank you. Will close this issue

@sujit-baniya
Copy link
Author

Hi @joway last night the system get crashed with a lot of messages related to NETPOLL

2023/07/04 14:42:06 NETPOLL: readall(fd=37) before close: EOF
2023/07/04 14:42:10 NETPOLL: readall(fd=16) before close: EOF
2023/07/04 14:42:10 NETPOLL: readall(fd=26) before close: EOF
2023/07/04 14:42:10 NETPOLL: readall(fd=28) before close: EOF
2023/07/04 14:42:10 NETPOLL: readall(fd=27) before close: EOF
2023/07/04 14:42:10 NETPOLL: readall(fd=37) before close: EOF
2023/07/04 14:42:10 NETPOLL: readall(fd=36) before close: EOF
2023/07/04 14:42:10 NETPOLL: readall(fd=26) before close: EOF
2023/07/04 14:42:10 NETPOLL: readall(fd=27) before close: EOF
2023/07/04 14:42:10 NETPOLL: readall(fd=28) before close: EOF
2023/07/04 14:42:10 NETPOLL: readall(fd=16) before close: EOF
2023/07/04 14:42:12 NETPOLL: readall(fd=26) before close: EOF
2023/07/04 14:42:12 NETPOLL: readall(fd=16) before close: EOF
2023/07/04 14:42:13 NETPOLL: readall(fd=28) before close: EOF
2023/07/04 14:42:14 NETPOLL: readall(fd=26) before close: EOF
2023/07/04 14:42:17 NETPOLL: readall(fd=16) before close: EOF
2023/07/04 14:42:17 NETPOLL: readall(fd=28) before close: EOF
2023/07/04 14:42:17 NETPOLL: readall(fd=26) before close: EOF
2023/07/04 14:42:20 NETPOLL: readall(fd=16) before close: EOF
2023/07/04 14:42:20 NETPOLL: readall(fd=28) before close: EOF
2023/07/04 14:42:20 NETPOLL: readall(fd=36) before close: EOF
2023/07/04 14:42:20 NETPOLL: readall(fd=26) before close: EOF
2023/07/04 14:42:20 NETPOLL: readall(fd=27) before close: EOF
2023/07/04 14:42:22 NETPOLL: readall(fd=26) before close: EOF
2023/07/04 14:42:22 NETPOLL: readall(fd=28) before close: EOF
2023/07/04 14:42:23 NETPOLL: readall(fd=16) before close: EOF
2023/07/04 14:42:23 NETPOLL: readall(fd=26) before close: EOF
2023/07/04 14:42:23 NETPOLL: readall(fd=27) before close: EOF
2023/07/04 14:42:23 NETPOLL: readall(fd=36) before close: EOF
2023/07/04 14:42:23 NETPOLL: readall(fd=28) before close: EOF
2023/07/04 14:42:25 NETPOLL: readall(fd=16) before close: EOF
2023/07/04 14:42:25 NETPOLL: readall(fd=27) before close: EOF
2023/07/04 14:42:25 NETPOLL: readall(fd=26) before close: EOF
2023/07/04 14:42:27 NETPOLL: readall(fd=26) before close: EOF
2023/07/04 14:42:27 NETPOLL: readall(fd=27) before close: EOF
2023/07/04 14:42:27 NETPOLL: readall(fd=16) before close: EOF
2023/07/04 14:42:27 NETPOLL: readall(fd=16) before close: EOF
2023/07/04 14:42:27 NETPOLL: readall(fd=26) before close: EOF
2023/07/04 14:42:29 NETPOLL: readall(fd=37) before close: EOF
2023/07/04 14:42:29 NETPOLL: readall(fd=16) before close: EOF
2023/07/04 14:42:29 NETPOLL: readall(fd=28) before close: EOF
2023/07/04 14:42:29 NETPOLL: readall(fd=27) before close: EOF
2023/07/04 14:42:29 NETPOLL: readall(fd=36) before close: EOF
2023/07/04 14:42:29 NETPOLL: readall(fd=26) before close: EOF
2023/07/04 14:42:31 NETPOLL: readall(fd=16) before close: EOF
2023/07/04 14:42:32 NETPOLL: readall(fd=27) before close: EOF
2023/07/04 14:42:37 NETPOLL: readall(fd=27) before close: EOF
2023/07/04 14:42:37 NETPOLL: readall(fd=16) before close: EOF
signal: killed
``

@welkeyever
Copy link
Member

Seem server received the KILL signal.
If it is unnecessary for user to perceive this type of log, you may post a method of muting it @joway

@welkeyever
Copy link
Member

Related to: cloudwego/netpoll#273

@joway
Copy link
Member

joway commented Jul 13, 2023

@sujit-baniya We found the root cause. Actualy, it will not cause any real problem on your case but just get some useless logs.

if you want to fix it you could use go get github.com/cloudwego/netpoll@develop

@sujit-baniya
Copy link
Author

@joway Thanks. Closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

4 participants