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

GenConsumer supervisor necessarily launches consumer module as a worker #390

Closed
tanguilp opened this issue Dec 24, 2019 · 1 comment
Closed

Comments

@tanguilp
Copy link

In https://github.com/kafkaex/kafka_ex/blob/master/lib/kafka_ex/gen_consumer/supervisor.ex#L92, we can see that the child is launched as a worker.

As a consequence, the shutdown timeout is automatically set to 5_000 ms (among other default settings). However, the child could be implemented as a supervisor, whose timeout would be :infinity (the supervisor being in charge of handling his children termination in time).

I suggest using the child specs mechanism and rewriting it to:

{gen_consumer_module, [consumer_module, group_name]}

so that child_spec/1 is called.

What do you thing?

@joshuawscott
Copy link
Member

I think refactoring to use the child specs would be good, and I think will be required to support Elixir 1.10 without generating compile warnings.

KafkaEx.GenConsumer does additional work besides just supervising, so making it a Supervisor might be problematic.

b1az added a commit to b1az/kafka_ex that referenced this issue Aug 25, 2022
This enables the usage of child_spec/1 and removal of
the deprecated Supervisor.Spec.supervisor/3 call.

Fixes kafkaex#390.
b1az added a commit to b1az/kafka_ex that referenced this issue Aug 25, 2022
This enables the usage of child_spec/1 and removal of
the deprecated Supervisor.Spec.supervisor/3 call.

Fixes kafkaex#390.
b1az added a commit to b1az/kafka_ex that referenced this issue Aug 25, 2022
This enables the usage of child_spec/1 and removal of
the deprecated Supervisor.Spec.supervisor/3 call.

Fixes kafkaex#390.
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

No branches or pull requests

2 participants