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

Docker Events Any Loss possible ? #859

Closed
FLavalliere opened this issue Jan 8, 2021 · 6 comments
Closed

Docker Events Any Loss possible ? #859

FLavalliere opened this issue Jan 8, 2021 · 6 comments

Comments

@FLavalliere
Copy link

Hello,

I've using another project called 'registrator'. I've created my own version out of if with some more features.

     // Start event listener before listing containers to avoid missing anything
        events := make(chan *dockerapi.APIEvents)
        assert(docker.AddEventListener(events))
        log.Println("Listening for Docker events ...")
        
  // Process Docker events
        for msg := range events {
            ..
        }

Somehow it seems i might not receive all events from the docker deamon. Would you know any resaons ?

@FLavalliere
Copy link
Author

Funny enough i'm also doing something like this :

       taskArnFilter := fmt.Sprintf("com.amazonaws.ecs.task-arn=%s", taskArn)
       log.Printf("Syncing services container id : %s and matching %s", ignoreId, taskArnFilter)
       arnFilters := map[string][]string{"label": {taskArnFilter}}
       containers, err := b.docker.ListContainers(dockerapi.ListContainersOptions{Filters: arnFilters})

Somehow it only return my own containers though the docker daemon should have two... if i dun the docker ps with the same filter it gives me two entries not 1

Not too sure if it might be a docker bug itself? or something else with listening at events..

@FLavalliere
Copy link
Author

I've updated the code to use AddListenerWithOptions and to only filter events that is of type

container with events of start,stop,kill, .... so this way it doesnt get into the 1000 lines limits... who knows :/

@stale
Copy link

stale bot commented Feb 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Feb 13, 2021
@fsouza
Copy link
Owner

fsouza commented Feb 15, 2021

Hey @FLavalliere, apologies for neglecting this issue. To be honest, I don't know if it's possible or not to lose events. Can you reproduce the issue you were seeing using just the docker cli, or provide a reproducible code snippet that I could use to try and test?

@stale stale bot removed the stale label Feb 15, 2021
@stale
Copy link

stale bot commented Mar 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Mar 19, 2021
@fsouza fsouza removed the stale label Mar 20, 2021
@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jun 2, 2021
@stale stale bot closed this as completed Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants