8000 Switch default event rule engine from python to java by joe4dev · Pull Request #11807 · localstack/localstack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Switch default event rule engine from python to java #11807

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

Closed
wants to merge 6 commits into from

Conversation

joe4dev
Copy link
Member
@joe4dev joe4dev commented Nov 7, 2024

Update: We decided against switching the default rule engine to avoid compatibility issues with the StepFunctions JPype integration.

Motivation

Our current Python-native event rule engine has many parity limitations compared to the Java-based event rule engine offering perfect AWS parity. This engine is used for:

This switch implies that we pick AWS parity over performance by default, but still offer users the option to choose.
Users behind enterprise proxies might also be interested in switching to the python-native event rule engine if they cannot download the JAR files from Maven central as reported in this issue #11299

The new Java-based rule engine was introduced in #10615 after adding an extensive test suite in #10599 and discovering many different implementations in LocalStack.

Changes

  • Change default for EVENT_RULE_ENGINE from python to java
  • Run full event pattern matching test suite for both event rule engines
  • Remove redundant monkeypatching for tests that are now passing by default with the new default event rule engine
  • Add feature flag to analytics such that we can track how many users switch the engine
  • Ship these ~2.5MB JARs to avoid dynamically downloading them. This resolves download issues such as bug: event-ruler failing to install in Docker with EventBridgeV2 #11299

Testing

Running a full localstack-ext test suite against this PR is highly recommended to detect potential incompatibilities with Kinesisanalyticsv2 (as initially noticed in #10615):

Limitations

The Java-based event rule engine has a performance penalty compared to the native Python implementation, especially for tail latency (spikes up to ~200ms).
For performance-sensitive users, we recommend opting in to the Python event rule engine if possible using EVENT_RULE_ENGINE=python.

@joe4dev joe4dev added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Nov 7, 2024
@joe4dev joe4dev added this to the 4.0 milestone Nov 7, 2024
@joe4dev joe4dev self-assigned this Nov 7, 2024
Copy link
github-actions bot commented Nov 7, 2024

S3 Image Test Results (AMD64 / ARM64)

  2 files    2 suites   4m 7s ⏱️
421 tests 369 ✅  52 💤 0 ❌
842 runs  738 ✅ 104 💤 0 ❌

Results for commit 77968e6.

♻️ This comment has been updated with latest results.

Copy link
github-actions bot commented Nov 7, 2024

LocalStack Community integration with Pro

    2 files  ± 0      2 suites  ±0   1h 46m 16s ⏱️ + 2m 48s
3 619 tests +78  3 176 ✅ +49  443 💤 +29  0 ❌ ±0 
3 621 runs  +78  3 176 ✅ +49  445 💤 +29  0 ❌ ±0 

Results for commit 5a5d659. ± Comparison against base commit 3de5aa9.

This pull request removes 78 and adds 156 tests. Note that renamed tests count towards both.
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays_NEG]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays_empty_EXC]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays_empty_null_NEG]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[boolean]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[boolean_NEG]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[complex_many_rules]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[complex_multi_match]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[complex_multi_match_NEG]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[complex_or]
…
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays-java]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays-python]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays_NEG-java]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays_NEG-python]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays_empty_EXC-java]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays_empty_EXC-python]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays_empty_null_NEG-java]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays_empty_null_NEG-python]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[boolean-java]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[boolean-python]
…
This pull request removes 29 skipped tests and adds 58 skipped tests. Note that renamed tests count towards both.
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays_empty_EXC]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[complex_or]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_anything_but_ignorecase]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_anything_but_ignorecase_list]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_anything_suffix]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_exists_false]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_ignorecase]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_ignorecase_NEG]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_ip_address]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_numeric_EXC]
…
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays_empty_EXC-java]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[arrays_empty_EXC-python]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[complex_or-java]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[complex_or-python]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_anything_but_ignorecase-java]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_anything_but_ignorecase-python]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_anything_but_ignorecase_list-java]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_anything_but_ignorecase_list-python]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_anything_suffix-java]
tests.aws.services.events.test_events_patterns.TestEventPattern ‑ test_event_pattern[content_anything_suffix-python]
…

♻️ This comment has been updated with latest results.

@joe4dev joe4dev force-pushed the switch-default-event-rule-engine branch 3 times, most recently from 00a6e18 to 1f44d52 Compare November 13, 2024 10:36
@joe4dev joe4dev force-pushed the switch-default-event-rule-engine branch 2 times, most recently from cf6521d to 5a5d659 Compare November 14, 2024 15:56
@dfangl dfangl force-pushed the switch-default-event-rule-engine branch from a53d955 to 77968e6 Compare November 18, 2024 15:28
@alexrashed alexrashed modified the milestones: 4.0, 4.1 Nov 20, 2024
@joe4dev joe4dev modified the milestones: 4.1, Playground Nov 22, 2024
@localstack-bot
Copy link
Collaborator

Currently, only patch changes are allowed on master. Your PR labels (semver: minor) indicate that it cannot be merged into the master at this time.

@joe4dev
Copy link
Member Author
joe4dev commented Nov 26, 2024

We decided against switching the default rule engine to avoid compatibility issues with the StepFunctions JPype integration. Therefore, we are closing this PR in favor of just adding the analytics in #11928

@joe4dev joe4dev closed this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0