Commit Graph

25 Commits

Author SHA1 Message Date
Kowser c08d60c8a4 fix(scheduler): return 404 from GET /schedules/{name} when the schedule does not exist (#1357)
Co-authored-by: Kowser <kowser.orkes@gmail.com>
2026-07-19 09:56:18 -07:00
Naomi Most 840ec19c1f Migrate JavaScript evaluator from Nashorn to GraalJS
Fixes #617

## Summary
Replaces deprecated Nashorn JavaScript engine (removed in Java 15) with
GraalJS, porting production-tested enterprise features from Orkes Conductor
to OSS.

## Enterprise Feature Port

This implementation is based on OrkesScriptEvaluator from Orkes Enterprise,
adapted for OSS with the following enterprise features:

### Ported Features:
- GraalJS engine implementation (battle-tested in production)
- Timeout protection (prevents runaway scripts)
- Context pooling (optional performance optimization)
- ConsoleBridge (console logging support)
- Deep copy protection (prevents PolyglotMap issues)
- Enhanced error handling (line number information)

### Excluded (Enterprise-only):
- Spring @Value configuration injection
- Enterprise telemetry/monitoring hooks
- Enterprise-specific error reporting

### Adapted for OSS:
- Environment variable configuration (vs Spring properties)
- Self-initializing with defaults (no Spring DI required)
- Simplified configuration model

## Changes

### Core Implementation
- Migrated ScriptEvaluator from Nashorn to GraalJS with timeout protection
- Added ConsoleBridge for console.log/info/error support
- Updated JavascriptEvaluator with deep copy protection for PolyglotMap issues
- Updated exception handling in DecisionTaskMapper, DoWhile, WorkflowTaskTypeConstraint

### Dependencies
- Added GraalJS dependencies (org.graalvm.js:js:24.1.0, js-scriptengine:24.1.0)
- Removed Nashorn dependency (org.openjdk.nashorn:nashorn-core)

### Features Added (from Enterprise)
- ES6+ JavaScript support (const, let, arrow functions, template literals, etc.)
- Script execution timeout protection (4 seconds default, configurable)
- Optional context pooling for improved performance
- Enhanced error messages with line number information
- ConsoleBridge for capturing console output in tasks
- Deep copy protection for workflow task data

### Configuration
New optional environment variables:
- CONDUCTOR_SCRIPT_MAX_EXECUTION_SECONDS (default: 4)
- CONDUCTOR_SCRIPT_CONTEXT_POOL_SIZE (default: 10)
- CONDUCTOR_SCRIPT_CONTEXT_POOL_ENABLED (default: false)

### Testing
- Updated existing ScriptEvaluator tests for GraalJS
- Added comprehensive TestGraalJSFeatures test suite (16 tests)
- Tests cover enterprise features: timeout, console, context pooling
- All tests passing with Java 17

## Backward Compatibility
- 100% backward compatible at application level
- All existing workflows continue to work unchanged
- No API changes, workflow definitions, or syntax changes
- Deprecated: CONDUCTOR_NASHORN_ES6_ENABLED env var (no longer needed)

## Version Impact
Minor version bump (3.23.0) - adds enterprise features, fixes deprecated
dependency, maintains backward compatibility. Java 17 requirement was
already established on main branch in PR #3733.

## Enterprise Parity
Brings OSS closer to feature parity with Orkes Enterprise by porting
production-tested JavaScript evaluation capabilities. Timeout protection
and error handling improvements are particularly valuable for production
deployments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 18:04:23 -07:00
Viren Baraiya 5091fdcd96 fixes 2023-12-20 12:45:39 -08:00
Raghavendra Chary B 62ee65ac13 Merge branch 'Netflix:main' into feature/task_status_listener 2023-06-13 09:40:15 +05:30
Lionel Fernandes c5343ac82c Add property for the timeout of sweeper polling 2023-06-01 14:33:00 +01:00
Raghavendra Chary B 9627d6b8ef Updated CHANGELOG.md with for conductor.task-status-listener.type. 2023-05-23 15:28:10 +05:30
Aravindan Ramkumar 2ccf09e1a3 Modules are linkable headings 2021-12-15 14:46:12 -08:00
GeorgiiShuev b4673608be es7-persistence module migration from 2.31.4 to 3.0.6 (#2324)
* es7-persistence module migration from 2.31.4 to 3.0.6

* revert conductor dependencies.lock

* finalize es7 migration

* update es-7 README.md

* update es-7 README

* rollback conductor es-7 properties migration

* fix:Create indexes on start-up including task_log one

* include es7-persistence to project

* shade es7-persistence

* fix es7 README.md

* replace deprecated method

* set ext['elasticsearch.version'] explicitly to avoid conflicts

* update es7-persistence README

* fix revElasticSearch7 version, shaded jar, add reminding note

* fix elasticsearch container version

* remove revElasticSearch7 from build.gradle

* remove not necessary ext['elasticsearch.version'], replace _index_template to _index

Co-authored-by: Marco Patricio Crasso <marco.crasso@invitae.com>
2021-08-10 10:52:53 -07:00
Noam Levy f9cb2d710d Add datadog metrics (#2332)
* add postgres missing dependency

* support datadog

* update datadog conditional property
2021-07-26 16:27:31 -07:00
michaelpaliy 084d45b607 update change log with latest Postgres and MySQL properties 2021-06-01 08:04:56 +03:00
Anoop Panicker 163f7c494f rename WorkflowPoller -> WorkflowReconciler; update property 2021-04-27 10:23:40 -07:00
Anoop Panicker 5b66205023 updated changelog 2021-04-14 15:19:01 -07:00
Anoop Panicker f372a91af8 updated CHANGELOG and dependencies 2021-04-09 18:00:36 -07:00
Anoop Panicker 8958144601 sync to master e328b5636b 2021-03-18 17:54:48 -07:00
Anoop Panicker 8b46925c61 removed unused method from IndexDAO 2021-03-15 14:46:19 -07:00
Anoop Panicker cce4837701 Upgrade nebula.netflixoss to replace bintray publication and update TravisCI secrets 2021-03-11 11:54:06 -08:00
Anoop Panicker 4b1162a800 disable background processes when instance is disabled 2021-03-10 13:26:25 -08:00
Andrea11 700fe9fc8c provide prometheus module for collector 2021-01-13 09:23:06 +01:00
Anoop Panicker 2466d20914 use test containers for mysql and postgres tests 2021-01-11 17:35:37 -08:00
Anoop Panicker 39ce909676 use springboot property conversion 2021-01-04 23:22:17 -08:00
Anoop Panicker bc66dfcfc1 cleanup all properties to follow a namespaced pattern 2020-12-29 09:55:31 -08:00
Aravindan Ramkumar d8961f1f5c classes moved to appropriate packages 2020-12-05 15:58:21 -08:00
Anoop Panicker cdd76455a1 ignored a flaky test 2020-12-03 23:28:11 -08:00
Aravindan Ramkumar c5c56a38a0 Switched to Spring Boot. See CHANGELOG.md for a rough log of changes in the branch. 2020-11-25 16:50:14 -08:00
Viren Baraiya fa9ead4635 Initial commit 2016-12-07 14:49:52 -08:00