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

adding an ftl.Call to another module causes infinite build/deploy loop #1202

Closed
mistermoe opened this issue Apr 8, 2024 · 2 comments · Fixed by #1274
Closed

adding an ftl.Call to another module causes infinite build/deploy loop #1202

mistermoe opened this issue Apr 8, 2024 · 2 comments · Fixed by #1274
Assignees

Comments

@mistermoe
Copy link
Member

module code is exact same as #1199 . here's what happened when i wrote that ftl.Call for the first time:

ftlbug.mov

no compile errors in project.

@github-actions github-actions bot added the triage Issue needs triaging label Apr 8, 2024
@alecthomas alecthomas mentioned this issue Apr 8, 2024
@wesbillman
Copy link
Member

I was able to catch a glipse of this issue happening and it seemed like rates/go.mod file was getting updated during the build triggering another build and it happened over and over many times. In my case, things eventually stopped deploying so I'm not 100% this was the exact issue.

@wesbillman
Copy link
Member

Ok got a log with debug:

debug: Extracting dependencies for module "rates"
info:rates: Building module
debug:rates: Generating external modules
debug:rates: Extracting schema
debug: changed module "rates": */Users/wesbillman/dev/deleteme/rates/go.mod
debug:rates: Generating main module
debug:rates: Tidying go.mod files
debug:rates: Compiling
info:rates: Deploying module
debug:rates: Uploading 0/1 files
debug:controller0: Created deployment rates-af886ed5c8
debug:controller0: Replace deployment for: rates-af886ed5c8
debug:controller0: Deployment already exists: rates-af886ed5c8
debug:rates: Waiting for deployment rates-af886ed5c8 to become ready
debug: changed module "rates": */Users/wesbillman/dev/deleteme/rates/go.mod
debug: Extracting dependencies for module "rates"
info:rates: Building module
debug:rates: Generating external modules
debug:rates: Extracting schema
debug:rates: Generating main module
debug:rates: Tidying go.mod files
debug: changed module "rates": */Users/wesbillman/dev/deleteme/rates/go.mod
debug:rates: Compiling
info:rates: Deploying module
debug:rates: Uploading 0/1 files
debug:controller0: Created deployment rates-af886ed5c8
debug:controller0: Replace deployment for: rates-af886ed5c8
debug:controller0: Deployment already exists: rates-af886ed5c8
debug:rates: Waiting for deployment rates-af886ed5c8 to become ready
debug: changed module "rates": */Users/wesbillman/dev/deleteme/rates/go.mod
debug: Extracting dependencies for module "rates"
info:rates: Building module
debug:rates: Generating external modules
debug:rates: Extracting schema
debug:rates: Generating main module
debug:rates: Tidying go.mod files
debug:rates: Compiling
info:rates: Deploying module
debug:rates: Uploading 0/1 files
debug:controller0: Created deployment rates-af886ed5c8
debug:controller0: Replace deployment for: rates-af886ed5c8
debug:controller0: Deployment already exists: rates-af886ed5c8
debug:rates: Waiting for deployment rates-af886ed5c8 to become ready
debug: Extracting dependencies for module "rates"
info:rates: Building module
debug:rates: Generating external modules
debug:rates: Extracting schema
debug: changed module "rates": */Users/wesbillman/dev/deleteme/rates/go.mod
debug:rates: Generating main module
debug:rates: Tidying go.mod files
debug:rates: Compiling
info:rates: Deploying module
debug:rates: Uploading 0/1 files
debug:controller0: Created deployment rates-af886ed5c8
debug:controller0: Replace deployment for: rates-af886ed5c8
debug:controller0: Deployment already exists: rates-af886ed5c8
debug:rates: Waiting for deployment rates-af886ed5c8 to become ready
debug: changed module "rates": */Users/wesbillman/dev/deleteme/rates/go.mod

And it seems like go.mod is just adding and removing this line require github.com/TBD54566975/ftl v0.163.4 (but it was flashing fast so hard to say for sure). And this rates module should not need require github.com/TBD54566975/ftl v0.163.4 since it's not using any ftl thing directly.

The final, good go.mod for this module is:

module ftl/rates

go 1.22.1

toolchain go1.22.2

@alecthomas alecthomas added next Work that will be be picked up next and removed triage Issue needs triaging labels Apr 9, 2024
@matt2e matt2e self-assigned this Apr 15, 2024
@github-actions github-actions bot removed the next Work that will be be picked up next label Apr 15, 2024
matt2e added a commit that referenced this issue Apr 22, 2024
fixes: #1202

Changes:
- file watch service now allows transactions that pause file update
logic on modules, and allows specific file changes to be explicitly
allowed (ie does not count as an update that triggers another build)
- building a go module uses a transaction to handle `go mod tidy`
commands
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

Successfully merging a pull request may close this issue.

4 participants