go-dockerclient icon indicating copy to clipboard operation
go-dockerclient copied to clipboard

fix event lost

Open ningmingxiao opened this issue 1 year ago • 7 comments

sometimes if listener chan is full,event will lost. @fsouza @bufdev can you review my pr? thank you

ningmingxiao avatar Aug 20 '24 08:08 ningmingxiao

@ningmingxiao I have not been involved in this repo for about a decade, it's not really professional to tag people here. Will leave this to others.

bufdev avatar Aug 28 '24 01:08 bufdev

sory,but thank you anyway.

ningmingxiao avatar Aug 28 '24 01:08 ningmingxiao

Thanks for contributing! This is a big change that can lead to slow consumers hanging. I recommend either making sure your caller is always fast enough to consume the events, or putting the new behavior behind a knob.

fsouza avatar Sep 22 '24 15:09 fsouza

sometimes I can't make sure consumers run faster, if run plenty of containers, will generate many events, channel will be filled. At least we should let user know event is dropped when chan is filled.

ningmingxiao avatar Sep 23 '24 01:09 ningmingxiao

Can you add a knob in that case?

fsouza avatar Oct 28 '24 02:10 fsouza

Can you add a knob in that case?

Could you describe it in more detail? Thank you

ningmingxiao avatar Oct 28 '24 02:10 ningmingxiao

@ningmingxiao I imagine we'd have a new option when adding the listener. Internally the listener would become some struct with the channel + some listening options, and externally we'd probably need to have versions of AddEventListenerWithOptions and RemoveEventListener that take a struct with "listening options" instead of just the channel.

fsouza avatar Oct 29 '24 13:10 fsouza