Giter Site home page Giter Site logo

Comments (4)

nbari avatar nbari commented on May 14, 2024

#32

probably option -r

from immortal.

nbari avatar nbari commented on May 14, 2024

currently testing with option -r and in the config with retries defaults to 0 which means unlimited

cmd: sleep 3
wait: 1
retries: 3

test using: immortal -c run.yml

from immortal.

nbari avatar nbari commented on May 14, 2024

Getting runtime error: invalid memory address or nil pointer dereference when sending exit signal and using immortaldir

The socket is created but the process is down or terminated, and when trying to get the pid the panic occurs:

  4 func (d *Daemon) HandleStatus(w http.ResponseWriter, r *http.Request) {
  3     status := Status{
  2         Cmd:   strings.Join(d.cfg.command, " "),
  1         Fpid:  d.fpid,
44          Pid:   d.process.Pid(),
  1         Count: atomic.LoadUint32(&d.count),
  2     }

panic output:

Jan  5 11:53:24 M20160001 immortal[32915]: http: panic serving : runtime error: invalid memory address or nil pointer dereference
        goroutine 18 [running]:
        net/http.(*conn).serve.func1(0xc420128000)
                /usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:1697 +0xd0
        panic(0x12e5260, 0x14de060)
                /usr/local/Cellar/go/1.9.2/libexec/src/runtime/panic.go:491 +0x283
        github.com/immortal/immortal.(*process).Pid(...)
                /Users/nbari/projects/go/src/github.com/immortal/immortal/process.go:158
        github.com/immortal/immortal.(*Daemon).HandleStatus(0xc4200606c0, 0x14b4920, 0xc42013a000, 0xc420130000)
                /Users/nbari/projects/go/src/github.com/immortal/immortal/socket.go:44 +0x90
        github.com/immortal/immortal.(*Daemon).HandleStatus-fm(0x14b4920, 0xc42013a000, 0xc420130000)
                /Users/nbari/projects/go/src/github.com/immortal/immortal/socket.go:33 +0x48
        net/http.HandlerFunc.ServeHTTP(0xc420042cb0, 0x14b4920, 0xc42013a000, 0xc420130000)
                /usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:1918 +0x44
        github.com/nbari/violetear.(*Router).ServeHTTP(0xc4200f9110, 0x14b4920, 0xc42013a000, 0xc420130000)
                /Users/nbari/projects/go/src/github.com/nbari/violetear/violetear.go:285 +0x43c
        net/http.serverHandler.ServeHTTP(0xc420112000, 0x14b4920, 0xc42013a000, 0xc420130000)
                /usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2619 +0xb4
        net/http.(*conn).serve(0xc420128000, 0x14b4e60, 0xc420116100)
                /usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:1801 +0x71d
        created by net/http.(*Server).Serve
                /usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2720 +0x288

This happens wuen using wait, there will be no process after X ammount of time:

Jan  5 12:59:32 M20160001 immortal[65951]: runtime error: invalid memory address or nil pointer dereference
Jan  5 12:59:32 M20160001 immortal[65951]: d = &{cfg:0xc4200b0500 count:1 lock:1 lockOnce:0 fpid:false process:<nil> quit:0xc420078120 

So need to check if the process exists before trying to get the PID.

from immortal.

nbari avatar nbari commented on May 14, 2024

fixed in 0.18.0

from immortal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.