Skip to content

Standalone ingestion in python is leaky due to not closing the MT pool #893

Closed

Description

@diogoncalves

Expected Behavior

Whenever we call client.ingest() it must close the multiprocesing pool after ingestion.

Current Behavior

Whenever we call client.ingest(), it calls get_feature_row_chunks from sdk/python/feast/loaders/ingest.py which opens a pool every time and does not close it.

This leads to a leaky behavior exploding memory and processor easily if running an ingestion in a loop.

Steps to reproduce

run the example of standalone ingestion in a loop.

Specifications

  • Version: v0.5.0
  • Platform: any
  • Subsystem: Feast Client

Possible Solution

Change https://github.com/feast-dev/feast/blob/master/sdk/python/feast/loaders/ingest.py#L142:

pool = Pool(max_workers)
func = partial(_encode_pa_tables, file, feature_set, field_map, ingestion_id)
for chunk in pool.imap(func, row_groups):
    yield chunk
return

To:

with Pool(max_workers) as pool:
    func = partial(_encode_pa_tables, file, feature_set, field_map, ingestion_id)
    for chunk in pool.imap(func, row_groups):
        yield chunk
return

Activity

  1. woop commented on Sep 11, 2020

    @woop
    Member

    FYI This ingestion method will be replaced completely in the coming versions.

  2. stale commented on Nov 10, 2020

    @stale

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

  3. added
    wontfix
    on Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions