ajvb / kala

Modern Job Scheduler
MIT License
2.13k stars 188 forks source link

Bug on starting job with no repetition when start time has passed #118

Closed MarcoVigna17 closed 8 years ago

MarcoVigna17 commented 8 years ago

There's a new bug regarding PR #116 , that causes a bug on R0 jobs on starting kala after the supposing start time has passed. How to reproduce:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x1871f2]

goroutine 1 [running]:
github.com/ajvb/kala/utils/iso8601.(*Duration).ToDuration(0x0, 0xd42f0fd)
    /Users/marco/Documents/projects/reachboot/workspace/go/src/github.com/ajvb/kala/utils/iso8601/iso8601.go:129 +0x32
github.com/ajvb/kala/job.(*Job).GetWaitDuration(0xc8200ae300, 0x0)
    /Users/marco/Documents/projects/reachboot/workspace/go/src/github.com/ajvb/kala/job/job.go:266 +0x19d
github.com/ajvb/kala/job.(*Job).StartWaiting(0xc8200ae300, 0xca1750, 0xc8200b8d00)
    /Users/marco/Documents/projects/reachboot/workspace/go/src/github.com/ajvb/kala/job/job.go:245 +0x30
github.com/ajvb/kala/job.(*MemoryJobCache).Start(0xc8200b8d00, 0x12a05f200)
    /Users/marco/Documents/projects/reachboot/workspace/go/src/github.com/ajvb/kala/job/cache.go:63 +0x22e
main.main.func2(0xc8200d08c0)
    /Users/marco/Documents/projects/reachboot/workspace/go/src/github.com/ajvb/kala/main.go:138 +0x55c
github.com/codegangsta/cli.Command.Run(0x4978c0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4a63a0, 0x8, 0x0, ...)
    /Users/marco/Documents/projects/reachboot/workspace/go/src/github.com/codegangsta/cli/command.go:174 +0x1397
github.com/codegangsta/cli.(*App).Run(0xc8200d0640, 0xc82000a140, 0x5, 0x5, 0x0, 0x0)
    /Users/marco/Documents/projects/reachboot/workspace/go/src/github.com/codegangsta/cli/app.go:187 +0x1135
main.main()
    /Users/marco/Documents/projects/reachboot/workspace/go/src/github.com/ajvb/kala/main.go:146 +0x9e8

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1721 +0x1

goroutine 5 [syscall]:
os/signal.loop()
    /usr/local/go/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
    /usr/local/go/src/os/signal/signal_unix.go:28 +0x37
exit status 2