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

Null pointer from hh caused panic #3

Open
andyli029 opened this issue May 25, 2023 · 1 comment
Open

Null pointer from hh caused panic #3

andyli029 opened this issue May 25, 2023 · 1 comment

Comments

@andyli029
Copy link
Owner

System info: [Include InfluxDB version, operating system name, and other relevant details]

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xf2c962]

goroutine 3153 [running]:
os.(*File).Name(...)
        /usr/local/go/src/os/file.go:55
github.com/influxdata/influxdb/services/hh.(*segment).lastModified(0xc0148f2ae0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /root/influxdb/services/hh/queue.go:748 +0x82
github.com/influxdata/influxdb/services/hh.(*queue).LastModified(0xc18f4d3b90, 0x0, 0x0, 0x0, 0x0, 0x0)
        /root/influxdb/services/hh/queue.go:231 +0x85
github.com/influxdata/influxdb/services/hh.(*NodeProcessor).LastModified(0xc2d0d1ec30, 0xc1977f9600, 0xc51b6bce50, 0xc138c58c30, 0x0, 0x0)
        /root/influxdb/services/hh/node_processor.go:201 +0x36
github.com/influxdata/influxdb/services/hh.(*Service).purgeInactiveProcessors.func1(0xc0001b00e0)
        /root/influxdb/services/hh/service.go:352 +0xa65
github.com/influxdata/influxdb/services/hh.(*Service).purgeInactiveProcessors(0xc0001b00e0)
        /root/influxdb/services/hh/service.go:390 +0xb4
created by github.com/influxdata/influxdb/services/hh.(*Service).Open
        /root/influxdb/services/hh/service.go:197 +0x44c

Steps to reproduce:

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Expected behavior: [What you expected to happen]

Actual behavior: [What actually happened]

Additional info: [Include gist of relevant config, logs, etc.]

If this is an issue of for performance, locking, etc the following commands are useful to create debug information for the team.

curl -o profiles.tar.gz "http://localhost:8086/debug/pprof/all?cpu=true"

curl -o vars.txt "http://localhost:8086/debug/vars"
iostat -xd 1 30 > iostat.txt

Please note It will take at least 30 seconds for the first cURL command above to return a response.
This is because it will run a CPU profile as part of its information gathering, which takes 30 seconds to collect.
Ideally you should run these commands when you're experiencing problems, so we can capture the state of the system at that time.

If you're concerned about running a CPU profile (which only has a small, temporary impact on performance), then you can set ?cpu=false or omit ?cpu=true altogether.

Please run those if possible and link them from a gist or simply attach them as a comment to the issue.

Please note, the quickest way to fix a bug is to open a Pull Request.

@andyli029
Copy link
Owner Author

andyli029 commented May 25, 2023

func (l *segment) lastModified() (time.Time, error) {
	l.mu.RLock()
	defer l.mu.RUnlock()

       stats, err := os.Stat(l.file.Name())
	if err != nil {
		return time.Time{}, err
	}
	return stats.ModTime().UTC(), nil
}

stats, err := os.Stat(l.file.Name())

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

No branches or pull requests

1 participant