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

Wait for yagna apis to be listening before starting agents #335

Merged
merged 3 commits into from
Nov 13, 2020

Conversation

maaktweluit
Copy link
Contributor

From a test run yesterday in requestor_agent.log:

[2020-11-12T18:57:38Z DEBUG ya_client::web] doing GET on http://proxy-nginx:6000/payment-api/v1/requestor/accounts
[2020-11-12T18:57:38Z DEBUG trust_dns_resolver::async_resolver::background] trust-dns resolver running
[2020-11-12T18:57:38Z DEBUG trust_dns_proto::xfer::dns_handle] querying: proxy-nginx A
[2020-11-12T18:57:38Z DEBUG trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: 127.0.0.11:53, protocol: Udp, tls_dns_name: None }
[2020-11-12T18:57:38Z DEBUG trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: 127.0.0.11:53, timeout: 5s }
[2020-11-12T18:57:38Z DEBUG trust_dns_proto::xfer] enqueueing message: [Query { name: Name { is_fqdn: false, labels: [proxy-nginx] }, query_type: A, query_class: IN }]
[2020-11-12T18:57:38Z DEBUG trust_dns_proto::xfer::dns_exchange] connection established: UDP(127.0.0.11:53)
[2020-11-12T18:57:38Z DEBUG trust_dns_proto::xfer::dns_exchange] sending message via: UDP(127.0.0.11:53)
[2020-11-12T18:57:38Z DEBUG trust_dns_proto::xfer::dns_exchange] all handles closed, shutting down: UDP(127.0.0.11:53)
[2020-11-12T18:57:38Z DEBUG trust_dns_proto::xfer::dns_exchange] io_stream is done, shutting down
[2020-11-12T18:57:38Z DEBUG trust_dns_proto::udp::udp_stream] created socket successfully
[2020-11-12T18:57:38Z DEBUG trust_dns_proto::rr::record_data] reading A
[2020-11-12T18:57:38Z DEBUG trust_dns_proto::udp::udp_client_stream] received message id: 53923
Error: request for http://proxy-nginx:6000/payment-api/v1/requestor/accounts resulted in HTTP status code: 502 Bad Gateway: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.19.4</center>
</body>
</html>

Fixed!

@maaktweluit maaktweluit self-assigned this Nov 13, 2020
@maaktweluit
Copy link
Contributor Author

Strange, it did not seem to work on the first run...

goth-logs (11).zip

needs more investigation i guess

@maaktweluit
Copy link
Contributor Author

Re-run worked fine, i'm going to prioritze other PRs

@kmazurek
Copy link
Contributor

It seems like current yagna master is not stable, I'm having similar issues since yesterday on two of my PRs (golemfactory/yagna#723, #334).

Copy link
Contributor

@kmazurek kmazurek left a comment

Choose a reason for hiding this comment

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

Let's move waiting for logs to AgentMixin since it's shared between the two agent classes.

"""Start the requestor agent and attach to its log stream."""

self._logger.info("Waiting for yagna apis to be listening...")
await self.container.logs.wait_for_entry(
"Starting .* service on .*.", timeout=300
Copy link
Contributor

Choose a reason for hiding this comment

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

The timeout here is different from the one in provider agent. Is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, the requestor is requesting funds, while the provider is not

Comment on lines +272 to +275
self._logger.info("Waiting for yagna apis to be listening...")
await self.container.logs.wait_for_entry(
"Starting .* service on .*.", timeout=10
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is copy-pasted between the two agents, maybe it's better to push it into their base class (i.e. AgentMixin)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the only differences are the timeout and the name of the starting binary, so can do :)

@maaktweluit maaktweluit merged commit db0804c into master Nov 13, 2020
@maaktweluit maaktweluit deleted the mwu/wait-agent branch November 13, 2020 13:09
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