timothyjward opened a new pull request, #35:
URL: https://github.com/apache/aries-typedevent/pull/35

   An event whose data contains a cycle caused a `StackOverflowError` on the 
delivery thread. The thread died and every later event was dropped. See 
https://github.com/osgi/org.osgi.service.typedevent/issues/20 for the 
specification discussion.
   
   * `EventConverter` tracks object identity while flattening, so a cycle is 
kept as a cyclic Map/List/Set graph for untyped handlers, filters and the 
monitor.
   * The flattened form is computed once (`Promise` completed through a 
compare-and-set). A conversion that fails is logged once and not retried, and 
the untyped, unhandled and monitor tasks skip the event.
   * Typed handlers of the same type still receive the original object with the 
cycle intact. Conversion to another type fails with an 
`IllegalArgumentException`.
   * `EventTask` also catches `StackOverflowError`, so a bad event or handler 
cannot end the delivery thread.
   * `RemoteEventMonitorImpl.flatten` tracks the enclosing maps, so remote 
filters on a cyclic event terminate.
   * `org.osgi.util.promise` is now a compile dependency of the bus module, 
imported as `[1.1,2)`.
   
   Covered by unit tests and the bnd integration tests (`mvn clean verify` on 
JDK 17, as the Byte Buddy version used by Mockito does not support JDK 26).
   
   The TCK test `test_deliver_nested_events_tree` is unchanged and still 
disabled: it expects `deliver` to throw, which this change does not do.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to