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

DiscoveryHandler is called for the first time after a minute from agent #563

Closed
mregen opened this issue Feb 28, 2023 · 5 comments
Closed
Labels
bug Something isn't working stale

Comments

@mregen
Copy link

mregen commented Feb 28, 2023

Describe the bug

After updating a helm chart with new configuration that requires a new start of the discovery handler, it takes one minute after registration until the first discover call is received. Can this delay be configured? If not, can you make it configurable?

Output of kubectl get pods,akrii,akric -o wide

NAME                                              READY   STATUS    RESTARTS         AGE     IP          NODE             NOMINATED NODE   READINESS GATES
pod/akri-agent-daemonset-jrx9t                    1/1     Running   28               5h55m   10.1.0.87   docker-desktop   <none>           <none>
pod/akri-controller-deployment-57c5dc7dc5-b5qjg   1/1     Running   28 (3m42s ago)   5h55m   10.1.0.86   docker-desktop   <none>           <none>
pod/akri-opcua-asset-discovery-daemonset-kr8gv    1/1     Running   0                9m59s   10.1.0.89   docker-desktop   <none>           <none>

NAME                                       CONFIG             SHARED   NODES                AGE
instance.akri.sh/akri-opcua-asset-6bc184   akri-opcua-asset   true     ["docker-desktop"]   2d6h
instance.akri.sh/akri-opcua-asset-6c9e9d   akri-opcua-asset   true     ["docker-desktop"]   11d
instance.akri.sh/akri-opcua-asset-fe7a3d   akri-opcua-asset   true     ["docker-desktop"]   11d

NAME                                     CAPACITY   AGE
configuration.akri.sh/akri-opcua-asset   1          12d

Kubernetes Version: [K8s]

To Reproduce

Steps to reproduce the behavior:

  1. Create cluster using '...'
  2. Install Akri with the Helm command '...'
  3. Start discovery handler with Helm command

Expected behavior

Delay from registration to first discover call is in the seconds range after registration or configurable.

Logs (please share snips of applicable logs)

2023-02-28 16:39:05.151 +00:00 info: OpcUaDetection.Akri.Program[0]      Akri OPC UA Detection (0.2.0-
2023-02-28 16:39:05.343 +00:00 info: OpcUaDetection.Akri.Program[0]      Got IP address of the pod from POD_IP environment variable.
2023-02-28 16:39:06.248 +00:00 info: OpcUaDetection.Akri.Program[0]      Registered with Akri system with Name opcua-asset for http://10.1.0.89:80 with type: Network as shared: True
2023-02-28 16:39:07.545 +00:00 info: Microsoft.Hosting.Lifetime[14]      Now listening on: http://[::]:80
2023-02-28 16:39:07.545 +00:00 info: Microsoft.Hosting.Lifetime[0]      Application started. Press Ctrl+C to shut down.
2023-02-28 16:39:07.545 +00:00 info: Microsoft.Hosting.Lifetime[0]      Hosting environment: Production
2023-02-28 16:39:07.545 +00:00 info: Microsoft.Hosting.Lifetime[0]      Content root path: /app/

---> 1 minute delay until first discovery call

2023-02-28 16:40:06.858 +00:00 info: OpcUa.Common.Client.OpcUaCore[0]       Checking application instance certificate.
2023-02-28 16:40:06.945 +00:00 info: OpcUa.Common.Client.OpcUaCore[0]      Creating application instance certificate.
2023-02-28 16:40:07.647 +00:00 info: OpcUa.Common.Client.OpcUaCore[512]      Imported the PFX private key for [3B0B2034BF6813194C6AF36A28A4C9F4AF16C058].
2023-02-28 16:40:07.742 +00:00 info: OpcUa.Common.Client.OpcUaCore[0]      Certificate created for urn:microsoft.com:ua:assetdetection. [CN=OpcUaDetection, O=Microsoft] [3B0B2034BF6813194C6AF36A28A4C9F4AF16C058]
2023-02-28 16:40:07.748 +00:00 info: OpcUaDetection.Akri.Services.DiscoveryHandlerService[0]
      Got discover request opcuaDiscoveryMethod:
        asset:
          endpointUrl: "opc.tcp://XXXXX:4840"
       from ipv6:[::ffff:10.1.0.87]:56096
@mregen mregen added the bug Something isn't working label Feb 28, 2023
@github-actions
Copy link
Contributor

Issue has been automatically marked as stale due to inactivity for 90 days. Update the issue to remove label, otherwise it will be automatically closed.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

Issue has been automatically marked as stale due to inactivity for 90 days. Update the issue to remove label, otherwise it will be automatically closed.

@github-actions github-actions bot added the stale label Sep 4, 2023
@kate-goldenring kate-goldenring moved this to Investigating in Akri Roadmap Oct 3, 2023
@johnsonshih
Copy link
Contributor

The delay comes from do_discover_on_discovery_handler, if get_stream returns None. Agent waits for 60 seconds, 60 seconds is hard-coded.
// If a connection cannot be established with the Discovery Handler, it will sleep and try again.

@github-actions github-actions bot removed the stale label Oct 5, 2023
Copy link
Contributor

github-actions bot commented Jan 4, 2024

Issue has been automatically marked as stale due to inactivity for 90 days. Update the issue to remove label, otherwise it will be automatically closed.

Copy link
Contributor

github-actions bot commented Apr 9, 2024

Issue has been automatically marked as stale due to inactivity for 90 days. Update the issue to remove label, otherwise it will be automatically closed.

@github-actions github-actions bot added the stale label Apr 9, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 8, 2024
@github-project-automation github-project-automation bot moved this from Investigating to Done in Akri Roadmap Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
Status: Done
Development

No branches or pull requests

3 participants