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

Fixed main-only bug in multi deployer. #422

Merged
merged 1 commit into from
Jun 28, 2023
Merged

Fixed main-only bug in multi deployer. #422

merged 1 commit into from
Jun 28, 2023

Conversation

mwhittaker
Copy link
Member

Before this PR, if you tried to weaver multi deploy a Service Weaver application that only had a main component, it would error out immediately with a "github.com/ServiceWeaver/weaver/Main not found".

Here's what was happening. weaver multi deploy read the component callgraph from the application binary to know which components existed. Reading the callgraph returns the edges in the graph. However, for an application with only a main component, there are no edges. Thus, weaver multi deploy erroneously concluded that there are no components.

This PR makes a dirt simple fix. We may want to revise the callgraph API to return nodes and edges in a future PR to make this problem harder to run into?

Also, sadly, applications that exit from main still exhibit odd behavior when deployed with weaver multi deploy. The hello world application added in this PR for example, doesn't print anything. I believe we aren't waiting to flush all messages over the pipe, but I'll have to debug further in a future PR.

@mwhittaker mwhittaker requested a review from spetrovic77 June 27, 2023 23:56
@mwhittaker mwhittaker self-assigned this Jun 27, 2023
Copy link
Contributor

@spetrovic77 spetrovic77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wowza! Can't believe we didn't run into this before.

Before this PR, if you tried to `weaver multi deploy` a Service Weaver
application that only had a main component, it would error out
immediately with a "github.com/ServiceWeaver/weaver/Main not found".

Here's what was happening. `weaver multi deploy` read the component
callgraph from the application binary to know which components existed.
Reading the callgraph returns the edges in the graph. However, for an
application with only a main component, there are no edges. Thus,
`weaver multi deploy` erroneously concluded that there are no
components.

This PR makes a dirt simple fix. We may want to revise the callgraph API
to return nodes and edges in a future PR to make this problem harder to
run into?

Also, sadly, applications that exit from main still exhibit odd behavior
when deployed with `weaver multi deploy`. The hello world application
added in this PR for example, doesn't print anything. I believe we
aren't waiting to flush all messages over the pipe, but I'll have to
debug further in a future PR.
@mwhittaker
Copy link
Member Author

Wowza! Can't believe we didn't run into this before.

Yeah, me too!

@mwhittaker mwhittaker merged commit a6ae48d into main Jun 28, 2023
@mwhittaker mwhittaker deleted the mainiac branch June 28, 2023 23:38
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 this pull request may close these issues.

2 participants