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

--watch should start new process after old process stopped #1631

Open
trim21 opened this issue May 2, 2024 · 1 comment
Open

--watch should start new process after old process stopped #1631

trim21 opened this issue May 2, 2024 · 1 comment
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@trim21
Copy link
Contributor

trim21 commented May 2, 2024

  • Task version: 3.36.0
  • Operating system: debian 10
  • Experiments enabled: no

I have a simple go program

package main

import (
	"io"
	"log"
	"net/http"
)

func main() {
	http.HandleFunc("/", func(writer http.ResponseWriter, r *http.Request) {
		print(r.URL.Query().Encode())
		io.WriteString(writer, "hello world 2")
	})

	log.Fatal(http.ListenAndServe(":8001", http.DefaultServeMux))
}

and task file:

version: 3

tasks:
  s:
    sources:
      - '*.go'
    cmd: go run main.go

whan I run it with task s --watch I encounter a error with 2024/05/02 13:38:59 listen tcp :8001: bind: address already in use.

It looks like task didn't stop old process cleanly before it start a new process?

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label May 2, 2024
@trim21
Copy link
Contributor Author

trim21 commented May 2, 2024

this works as expected

version: 3

tasks:
  build:
    sources:
      - '*.go'
    generates:
      - out
    cmd: go build -o out main.go

  s:
    deps: [ build ]
    cmd: ./out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs triage Waiting to be triaged by a maintainer.
Projects
None yet
Development

No branches or pull requests

2 participants