Skip to content

When using event_manager to initialize the crawler, the global event_manager doesn't work. #1808

Closed

Description

@Mantisus

If event_manager is passed as an initialization parameter to BasicCrawler, the global event_manager in service_locator will never be started.

https://github.com/apify/crawlee-python/blob/master/src/crawlee/crawlers/_basic/_basic_crawler.py#L770-L778

As a result, classes that use service_locator.get_event_manager() do not behave as expected, because they do not receive the relevant events.

Classes affected by this issue: Snapshotter and RecoverableState.

Related: #1805

Also, if two crawlers share the global event_manager and one finishes before the other, the event_manager will be shut down for the second crawler as well.

Activity

  1. added
    t-toolingIssues with this label are in the ownership of the tooling team.
    on Mar 24, 2026
  2. changed the title [-]When using `event_manager` to initialize the crawler, the global `event_manager` is not work.[/-] [+]When using `event_manager` to initialize the crawler, the global `event_manager` doesn't work.[/+] on Mar 24, 2026
  3. Pijukatel commented on Mar 25, 2026

    @Pijukatel
  4. added a commit that references this issue on Apr 1, 2026
    2efb668
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions