local-transform throws rpl.rama.distributed.exceptions.IllegalWriteException: null

34 views
Skip to first unread message

Michael Frericks

unread,
Aug 27, 2025, 9:28:52 AMAug 27
to rama-user
Hi,
i am a liitle bit lost in the stacktraces of rama 

1. Situation
1.1 I implement a single Module
1.2 With 2 normal depots and one tick depot
1.3 when sourcing from the tick depot like so 


               (println "*participant-ids-of-participants-in-state-ready" *participant-ids-of-participants-in-state-ready)
               (println "loop over participants in state READY")
               (loop<- [*candidate-ids *participant-ids-of-participants-in-state-ready :> *selected-participant-id]
                       (first *candidate-ids :> *candidate-id)
                       (<<if (not-nil? *candidate-id)
                             (println  (format "task-id='%s'" (ops/current-task-id)))
                             (|hash *candidate-id)
                             (println  (format "task-id='%s'" (ops/current-task-id)))
                             (local-select> [(keypath *candidate-id)] $$participant-state :> *candidate)
                             (println (format "conference='%s'" *conference))
                             (println (format "candidate='%s'" *candidate))
                             (ready-to-join-conference? *conference *candidate :> *candidate-suitable?)
                             (println (format "*candidate-suitable?='%s'" *candidate-suitable?))
                             (<<if *candidate-suitable?
                                   (:> *candidate-id)
                                   ;; change PStates
                                   (println  (format "task-id='%s'" (ops/current-task-id)))
                                   (println  (format "add participant-conference: cand='%s', conf='%s'" *candidate-id *conference-id-queued))
                                   (local-transform> [(keypath *candidate-id :conferences *conference-id-queued)
                                                      (termval (hash-map :state "ASSIGNED"))] $$participant-state)
                                   (println "xxx")
1.4 the  (println "xxx) does not happen
1.5 Instead i get  a stacktrace
>>>>>>>>>>>>>>>

rpl.rama.distributed.exceptions.IllegalWriteException: null
at rpl.rama.platform.bytecode.VanillaFnFragChunk.invokeBasic(VanillaFnFragChunk.java:359) ~[rama-1.0.0.jar:?]
at rpl.rama.distributed.pobject.pstate.topology.check_valid_writer_BANG_.invokeBasicVariadic(rpl/rama/distributed/pobject/pstate/topology.clj:866) ~[rama-1.0.0.jar:?]
at rpl.rama.distributed.pobject.pstate.topology.local_transform_GT__STAR__LocalPartitionedState.invoke(rpl/rama/distributed/pobject/pstate/topology.clj:875) ~[rama-1.0.0.jar:?]
at rpl.rama.api3.parallel.local_transform_GT__STAR_.invoke(rpl/rama/api3/parallel.clj:65535) ~[rama-1.0.0.jar:?]
at omnibus.omnibus$fn$reify__3793.omnibus.omnibus_SLASH__Omnibus$runner45358$entry45368$entry4536849094$ctn49206.invoke(omnibus.omnibus$fn$reify__3793:133) ~[?:?]
at rpl.rama.api2.state_contents.select_GT__STAR_$ctn42701.invoke(rpl/rama/api2/state_contents.clj:65535) ~[rama-1.0.0.jar:?]
at rpl.rama.distributed.pobject.pstate.topology.select_GT__STAR__LocalPartitionedState$ctn198578.invoke(rpl/rama/distributed/pobject/pstate/topology.clj:741) ~[rama-1.0.0.jar:?]
at rpl.rama.distributed.pobject.pstate.topology.local_pstate_select_GT__STAR_$ctn198333.invoke(rpl/rama/distributed/pobject/pstate/topology.clj:633) ~[rama-1.0.0.jar:?]
at rpl.rama.api2.state_contents.select_GT__STAR_$ctn42701.invoke(rpl/rama/api2/state_contents.clj:65535) ~[rama-1.0.0.jar:?]
at rpl.rama.distributed.topology.streaming.select_GT__STAR__StreamingState$ctn321500.invoke(rpl/rama/distributed/topology/streaming.clj:1740) ~[rama-1.0.0.jar:?]
at rpl.rama.distributed.monitoring.pobject.pstate.pstate_telemetry.timed_select$ctn192884.invoke(rpl/rama/distributed/monitoring/pobject/pstate/pstate_telemetry.clj:239) ~[rama-1.0.0.jar:?]
at rpl.rama.distributed.topology.streaming.select_GT__STAR__StreamingState$select$ctn321496.invoke(rpl/rama/distributed/topology/streaming.clj:1739) ~[rama-1.0.0.jar:?]
at rpl.rama.api2.state_contents.select_GT__STAR_$ctn42701.invoke(rpl/rama/api2/state_contents.clj:65535) ~[rama-1.0.0.jar:?]
at rpl.rama.api2.state.select_GT__STAR__State$ctn48448.invoke(rpl/rama/api2/state.clj:668) ~[rama-1.0.0.jar:?]
at rpl.rama.api2.state_contents.select_GT__STAR_$ctn42701.invoke(rpl/rama/api2/state_contents.clj:65535) ~[rama-1.0.0.jar:?]
at rpl.rama.distributed.pobject.pstate.contents.select_GT__STAR__RefCounted$ctn246477.invoke(rpl/rama/distributed/pobject/pstate/contents.clj:195) ~[rama-1.0.0.jar:?]
at rpl.rama.api2.state_contents.select_GT__STAR_$ctn42701.invoke(rpl/rama/api2/state_contents.clj:65535) ~[rama-1.0.0.jar:?]
at rpl.rama.api.durable.durable_sorted_map.select_GT__STAR__DurableSortedMap$ctn184205.invoke(rpl/rama/api/durable/durable_sorted_map.clj:220) ~[rama-1.0.0.jar:?]
at rpl.rama.api2.state_contents.select_GT__STAR_$ctn42701.invoke(rpl/rama/api2/state_contents.clj:65535) ~[rama-1.0.0.jar:?]

<<<<<<<<<<<<<<<<<<<<<

1.5 Any hints  why IllegalWriteException does occur

Michael Frericks

unread,
Aug 27, 2025, 9:32:38 AMAug 27
to rama-user
Ups cut off the sourcing code. 
(let [tick-conference (stream-topology topologies "stream-tick-conference")]
    (<<sources tick-conference
               ;; do periodically
               (source> *conference-tick)
               (|all)
               ;; queue new conferences
               (local-select> [ALL (pred conference/map-entry-pred-created) FIRST] $$conferences :> *conference-id-created)
               (println (format "*conference-id-created='%s'" *conference-id-created))
               (local-transform> [(keypath *conference-id-created :state) (termval (conference/next-state "CREATED" "add"))] $$conferences)
               
               ;; assign queued conferences
               (local-select> [ALL (pred conference/map-entry-pred-queued) FIRST] $$conferences :> *conference-id-queued)
               (println "*conference-id-queued" *conference-id-queued)
               (local-select> [(keypath *conference-id-queued)] $$conferences :> *conference)
               (invoke-query "query-participant-ids-by-state" "READY" :> *participant-ids-of-participants-in-state-ready)

               (println "*participant-ids-of-participants-in-state-ready" *participant-ids-of-participants-in-state-ready)
               (println "loop over participants in state READY")
               (loop<- [*candidate-ids *participant-ids-of-participants-in-state-ready :> *selected-participant-id]
                       (first *candidate-ids :> *candidate-id)
                       (<<if (not-nil? *candidate-id)
                             (println  (format "task-id='%s'" (ops/current-task-id)))
                             (|hash *candidate-id)
                             (println  (format "task-id='%s'" (ops/current-task-id)))
                             (local-select> [(keypath *candidate-id)] $$participant-state :> *candidate)
                             (println (format "conference='%s'" *conference))
                             (println (format "candidate='%s'" *candidate))
                             (ready-to-join-conference? *conference *candidate :> *candidate-suitable?)
                             (println (format "*candidate-suitable?='%s'" *candidate-suitable?))
                             (<<if *candidate-suitable?
                                   (:> *candidate-id)
                                   ;; change PStates
                                   (println  (format "task-id='%s'" (ops/current-task-id)))
                                   (println  (format "add participant-conference: cand='%s', conf='%s'" *candidate-id *conference-id-queued))
                                   (local-transform> [(keypath *candidate-id :conferences *conference-id-queued)
                                                      (termval (hash-map :state "ASSIGNED"))] $$participant-state)
                                   (println "xxx")

Nathan Marz

unread,
Aug 27, 2025, 10:19:49 AMAug 27
to rama...@googlegroups.com
That exception means you're trying to write to a PState not owned by that topology. This is discussed on the PStates documentation.

This line from the stack trace indicates it's happening on line 133, which must be that local-transform> call: omnibus.omnibus$fn$reify__3793.omnibus.omnibus_SLASH__Omnibus$runner45358$entry45368$entry4536849094$ctn49206.invoke(omnibus.omnibus$fn$reify__3793:133) ~[?:?]

--
You received this message because you are subscribed to the Google Groups "rama-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rama-user+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/rama-user/bb682b00-77e6-4dfc-8126-e7b5857fb4e0n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages