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

Hot reload does not detect changes #215

Closed
vcraescu opened this issue Oct 2, 2018 · 9 comments

Comments

@vcraescu
Copy link

commented Oct 2, 2018

Hi,

I'm using a docker image to fire up aah framework https://hub.docker.com/_/golang/ but hot reload not always detect the changes. This is my Dockerfile:

FROM golang:1.11

RUN go get -u aahframework.org/tools.v0/aah

WORKDIR /go/src/github.com/foobar/foobar
COPY . .

RUN go get -d -v ./...
RUN go install -v ./... || true

CMD ["aah", "run"]

This is very frustrating and I can't figure out why is that happening.
Makes developing a cumbersome especially when I do some refactoring cause I don't know If I did broke something or just the old code running. I have to restart the container from time to time to be sure I'm running the latest changes.

I'm using aah version 0.11 on a Linux machine:

Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.11
 Git commit:        e68fc7a215
 Built:             Fri Sep  7 11:26:59 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.11
  Git commit:       e68fc7a215
  Built:            Fri Sep  7 11:26:11 2018
  OS/Arch:          linux/amd64
  Experimental:     false

Thanks!

@DiliBau

This comment has been minimized.

Copy link

commented Oct 2, 2018

👍 can confirm this happens to be both in a container and when running directly on my machine, same docker versions and same go versions as @vcraescu running on Manjaro linux

@jeevatkm

This comment has been minimized.

Copy link
Member

commented Oct 2, 2018

@vcraescu @DiliBau Thank you for reporting an issue. I will look into it.

Did you observed any pattern or behavior or steps around hotreload to replicate the issue?

Also could you share your holreloqd config from file aah.project?

@jeevatkm jeevatkm self-assigned this Oct 2, 2018

@jeevatkm jeevatkm added the analysis label Oct 2, 2018

@vcraescu

This comment has been minimized.

Copy link
Author

commented Oct 2, 2018

@jeevatkm This config?

hot_reload {
  # Default value is `true`.
  enable = true

  # Watch configuration - files/directories exclusion list.
  #
  # For valid pattern syntax, refer to https://golang.org/pkg/path/filepath/#Match
  watch {
    # Note: static directory is not required to be monitored since aah server
    # delivers up-to-date file on environment profile `dev`.
    dir_excludes = [".*", "sessions"]

    file_excludes = [".*", "_test.go", "LICENSE", "README.md"]
  }
}

I believe it's the default one.

I didn't notice a pattern, just sometimes it stops detecting the changes and I have to stop/start aah run to make it work.

@jeevatkm

This comment has been minimized.

Copy link
Member

commented Oct 2, 2018

Yes this is the config. Thanks.

Okay so it stops detecting changes after a while.

@jeevatkm

This comment has been minimized.

Copy link
Member

commented Oct 3, 2018

@vcraescu Update: Last night I was analyzing and trying to find the root cause. As of now no luck. One way I could think of is to update/optimize the file change detect logic in the aah CLI (upcoming release).

@jeevatkm jeevatkm added this to the v0.12.0 Milestone milestone Oct 3, 2018

@jeevatkm jeevatkm added this to v0.12.0 - Iteration in aah Roadmap Oct 3, 2018

@vcraescu

This comment has been minimized.

Copy link
Author

commented Oct 4, 2018

But did you manage to reproduce the issue? I switched to OSX and I can reproduce the issue there too.

@jeevatkm

This comment has been minimized.

Copy link
Member

commented Oct 4, 2018

@vcraescu I was able to reproduce the scenario of "hot reload reflects the changes on second refresh" it happened many iteration of change detection(s). That's why I thought update the hot reload flow and handling.

@vcraescu

This comment has been minimized.

Copy link
Author

commented Oct 4, 2018

Thanks for taking time to fix this. 👍
I will wait 0.12 version.

jeevatkm added a commit to go-aah/tools that referenced this issue Oct 4, 2018

@jeevatkm jeevatkm moved this from v0.12.0 - Iteration to v0.12.0 - In Progress in aah Roadmap Oct 6, 2018

@jeevatkm

This comment has been minimized.

Copy link
Member

commented Oct 18, 2018

Applied fix as well as improvements.

@jeevatkm jeevatkm closed this Oct 18, 2018

aah Roadmap automation moved this from v0.12.0 - In Progress to v0.12.0 - Completed Oct 18, 2018

jeevatkm added a commit to go-aah/tools that referenced this issue Nov 2, 2018

@jeevatkm jeevatkm moved this from v0.12.0 - Completed to Released to Audience in aah Roadmap Dec 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.