* Fix stdout/stderr deadlock in CmdHelper.RunCmdAndGetOutput
Read stdout and stderr concurrently to prevent pipe buffer deadlock.
The sequential ReadToEnd() calls caused a hang when child processes
(e.g. dotnet build) produced enough stderr output to fill the OS
pipe buffer (~4KB on Windows), since the parent blocked on stdout
while the child blocked on stderr.
Made-with: Cursor
* Simplify Task.WhenAll result handling per review
Made-with: Cursor
* Add test for CmdHelper to prevent stdout/stderr deadlock
* Reduce timeout in deadlock test for CmdHelper to 10 seconds
---------
Co-authored-by: maliming <malimings@gmail.com>
- Remove "Unknown event name" exception from all providers and LocalEventBus
to match typed PublishAsync behavior (no handler = silent, not exception)
- Use ABP's IJsonSerializer instead of System.Text.Json for ConvertDynamicEventData
to respect configured JSON serialization options
- Fix reflection method lookup in DefaultDynamicBackgroundJobManager to match by parameter types
- Add StopAllAsync to IDynamicBackgroundWorkerManager interface and all implementations
- Add semaphore locking to StopAllAsync in DefaultDynamicBackgroundWorkerManager with volatile _isDisposed
- Fix HangfireDynamicBackgroundWorkerManager.GetCron to match existing HangfireBackgroundWorkerManager format
- Fix QuartzDynamicBackgroundWorkerManager.UpdateScheduleAsync to reuse BuildTrigger method
- Fix TickerQDynamicBackgroundWorkerManager.IsRegistered to throw AbpException (consistent with other methods)
- Add GetAllNames and Clear to IDynamicBackgroundWorkerHandlerRegistry
- Call StopAllAsync in AbpBackgroundWorkersModule.OnApplicationShutdownAsync
- Move DynamicBackgroundWorkerManager_Tests to correct namespace/directory
- Fix singleton state pollution in BackgroundJobManager_Tests
- Update docs to warn about handler loss after restart for dynamic jobs and workers
Add SemaphoreSlim to DefaultDynamicBackgroundWorkerManager to protect
AddAsync/RemoveAsync/UpdateScheduleAsync from concurrent access on the
same worker name. Add 3 concurrency test cases covering concurrent
same-name add, concurrent add+remove, and concurrent mixed operations.
Extract override method resolution logic into a reusable GetEffectiveMethodInfo helper to avoid duplication.
Use the resolved override method in ValidateActionArgumentsAsync so that IMethodInvocationValidator validates
against the concrete method on the controller type, not the base method from ActionDescriptor.
Remove unused imports in FluentValidationTestAppService_Tests.
When Application Services are registered via ConventionalControllers.Create(),
their types are added to DynamicProxyIgnoreTypes, which disables the
ValidationInterceptor. The AbpValidationActionFilter only checked ModelState
(DataAnnotations), so FluentValidation rules were never executed.
Add IValidationEnabled check in AbpValidationActionFilter to call
IMethodInvocationValidator for conventional controllers, enabling
FluentValidation support without duplicating validation for regular controllers.
Resolve#23457
- Add ConfigurePolicy method to AbpOperationRateLimitingOptions for
partial modification of existing policies without full replacement
- Add ClearRules method to OperationRateLimitingPolicyBuilder for
clearing inherited rules before defining new ones
- Add FromPolicy factory method to reconstruct a builder from an
existing policy
- Change AddPolicy return type to AbpOperationRateLimitingOptions
for chaining consistency with ConfigurePolicy
- Add parameter validation to AddPolicy and FromPolicy
- Add documentation for overriding existing policies
- Add tests for ConfigurePolicy, ClearRules, chaining, and error cases
Add schedule validation and make dynamic workers replaceable. Introduced DynamicBackgroundWorkerSchedule.Validate (checks Period > 0) and call Validate() in all provider managers (in-memory, Hangfire, Quartz, TickerQ). Switched in-memory dynamic worker storage to ConcurrentDictionary and ensure adding a worker with an existing name stops/removes the previous instance before registering the new one; removals use TryRemove. Updated docs to clarify that adding a worker replaces an existing one and that CronExpression is only supported by scheduler-backed providers. Added tests for replacement behavior and invalid period values.
Move DynamicBackgroundWorkerHandlerRegistry.Register calls to after scheduling to avoid registering handlers when scheduling fails. Adjust Quartz behaviour to return actual outcomes: only unregister when DeleteJob reports deletion and return whether RescheduleJob succeeded. Convert TickerQ RemoveAsync to a non-async Task<bool> (using Task.FromResult) and move its registration similarly. Update test to poll with a timeout (instead of a fixed 500ms delay) to wait for background worker execution.
Introduce RemoveAsync and UpdateScheduleAsync to IBackgroundWorkerManager and implement them for the default in-memory manager, Hangfire, Quartz and TickerQ providers. The default BackgroundWorkerManager now tracks dynamic workers in a dictionary, supports stopping/removing workers and recreating workers with a new schedule; provider-specific managers update scheduler entries or remove recurring jobs accordingly. Documentation updated with usage examples for removing and updating schedules, and unit tests added to cover removal, schedule updates and non-existent worker behavior.
Introduce runtime dynamic background workers: add DynamicBackgroundWorkerExecutionContext, DynamicBackgroundWorkerSchedule, IDynamicBackgroundWorkerHandlerRegistry and its implementation. Extend IBackgroundWorkerManager with AddAsync overloads to register handlers by name and schedule. Provide InMemoryDynamicBackgroundWorker for in-process execution and provider-specific adapters/implementations for Hangfire, Quartz and TickerQ (including Hangfire/Quartz/TickerQ adapters and manager changes) to schedule and execute dynamic handlers. Update BackgroundWorkerManager to hold IServiceProvider and the handler registry and wire DI through constructors. Add a docs example and unit tests to verify handler registration and execution.
Add native anonymous event support and simplify handling across transports. AnonymousEventData now contains conversion helpers (ConvertToTypedObject/ConvertToTypedObject<T>/ConvertToTypedObject -> loose typed object), caching JSON elements and replacing the removed AnonymousEventDataConverter. Multiple distributed event bus implementations (Azure, Dapr, Kafka, RabbitMQ, Rebus) were updated to: detect anonymous handlers via AnonymousHandlerFactories, construct AnonymousEventData when appropriate, resolve event types at publish/process time, simplify Subscribe/Unsubscribe logic (avoid duplicate-factory checks using IsInFactories then add), and throw on unknown event names in PublishAsync. AbpAspNetCoreMvcDaprEventBusModule was refactored to deserialize and trigger handlers inline for both envelope and direct Dapr events. Tests updated accordingly and a small cursor hook state file was added.
Rename the internal anonymous transport job name from "AnonymousJob" to "Abp.AnonymousJob" and update docs accordingly. Add null/whitespace argument checks (Check.NotNull / Check.NotNullOrWhiteSpace) in anonymous handler registration and lookup APIs. Change background job managers (Hangfire, Quartz, RabbitMQ, TickerQ, Default) to only wrap jobs as anonymous when an anonymous handler is registered and there is no typed job configuration (check via BackgroundJobOptions.GetJobOrNull). Wire AbpBackgroundJobOptions into affected managers and update tests with a new case verifying that a typed job prevents anonymous wrapping.
Introduce AnonymousJobExecutionContext and switch anonymous job handler APIs to accept it (Func<AnonymousJobExecutionContext, CancellationToken, Task> / Action<AnonymousJobExecutionContext, CancellationToken>). Update AbpBackgroundJobOptions, IAnonymousJobHandlerRegistry, AnonymousJobHandlerRegistry and AnonymousJobExecutorAsyncBackgroundJob to use the new context and to obtain a cancellation token via ICancellationTokenProvider. Update all callsites (tests, demo module, sample job creator) and documentation to show registering/enqueuing anonymous handlers by name and explain Hangfire display behavior. Also add a .cursor hooks state file. The demo no longer skips enqueuing anonymous jobs for RabbitMQ in this change.
Centralize and simplify anonymous event handling across transports. Introduces AnonymousEventDataConverter and changes AnonymousEventData to store optional JsonData with a FromJson factory. Adds helpers (CreateAnonymousEnvelope, TryPublishTypedByEventNameAsync, TryResolveStoredEventData, TryResolveIncomingEvent) and unifies handling logic in Dapr/Azure/Kafka/RabbitMQ/Rebus implementations. Also deduplicates subscription registration using locking, cleans up empty anonymous handler maps, and removes duplicated JSON conversion code. Tests updated to match the new anonymous event semantics.
Introduce anonymous/background-job-by-name support: add AnonymousJobArgs, IAnonymousJobHandlerRegistry and AnonymousJobHandlerRegistry, and an AnonymousJobExecutorAsyncBackgroundJob to execute JSON-based anonymous handlers. AbpBackgroundJobOptions now stores anonymous handlers and exposes registration/query helpers. Updated background job managers (Default, Hangfire, Quartz, RabbitMQ, TickerQ) to wrap registered anonymous jobs into AnonymousJobArgs when enqueuing and to depend on the handler registry and JSON serializer where needed. Removed the old dynamic handler types/APIs (DynamicBackgroundJobContext, IDynamicBackgroundJobHandlerProvider, DynamicBackgroundJobHandlerProvider) and related dynamic handling code; BackgroundJobConfiguration simplified (JobType non-nullable) and JobExecutionContext no longer carries JobName. Tests and demo code updated to use anonymous handlers and tracking. This change centralizes runtime-registered handlers keyed by job name and standardizes anonymous job payloads as JSON.
Introduce dynamic background job support so jobs can be registered and executed without a compile-time job type. Key changes:
- Add DynamicBackgroundJobContext, IDynamicBackgroundJobHandlerProvider and DynamicBackgroundJobHandlerProvider to allow registering/unregistering dynamic handlers at runtime.
- Extend BackgroundJobConfiguration with DynamicHandler and IsDynamic, and make JobType nullable for dynamic scenarios.
- Update AbpBackgroundJobOptions to use a ConcurrentDictionary for name lookup, and add methods to Add/Remove dynamic jobs and GetJobOrNull.
- Extend JobExecutionContext with JobName and propagate it through Hangfire/Quartz/RabbitMQ/TickerQ adapters and worker code.
- Update BackgroundJobExecuter to detect and execute dynamic handlers, deserialize/ensure dictionary args, and retain existing typed execution path.
- Add tests (DynamicJobExecutionTracker, runtime/compile-time dynamic handler tests) and register a sample dynamic job in test module.
- Update demo SampleJobCreator and DemoAppSharedModule to demonstrate compile-time and runtime dynamic job registration and enqueueing.
These changes enable flexible, dictionary-based job arguments and runtime registration of background job handlers while preserving existing typed job execution.
Add non-generic EnqueueAsync(string jobName, object args, ...) to IBackgroundJobManager and implement it across providers. Implementations and helpers added/updated for Hangfire (IJsonSerializer usage, new HangfireJobExecutionAdapter), Quartz (new QuartzJobExecutionAdapter and job-data based enqueue), RabbitMQ (IJobQueue non-generic EnqueueAsync, JobQueueManager.GetAsync(jobName)), TickerQ (reflective CreateTickerRequest helper), and DefaultBackgroundJobManager (returns string ids). Also update NullBackgroundJobManager to throw for the new overload and extend tests to cover enqueueing by job name. These changes enable enqueueing jobs dynamically by name with serialized arguments and unify cross-provider execution paths.