Same code works differently on different Cadence instances

Hey, I have an issue where the same code works differently on different instances of cadence. I’ve introduced new field (namely deviceNotFoundError) in the activity result class and this field is not reflected at all in one cadence instance. Please find details below. If more details are required feel free to ask, as a new user I cannot include images :confused:

1 Like

Cadence/Temporal service doesn’t interpret input and output of activities. So all of the serialization/deserialization code belongs to the client SDKs. It looks like one of the processes wasn’t updated. Another possibility is that the update happened after that part of the workflow already executed.

1 Like

On one instance of cadence I’ve created a brand new domain and I’ve boot up only one instance of the application (cadence workflow and activities implementation). I did the same thing on other instance of cadence. Same code and environment, same responses from API’s only cadence instances are different. There is a different behaviour on those instances, in particular one instance doesn’t show deviceNotFoundError field in activity result, where the other does.

Cadence service doesn’t interpret the payloads, so the issue is with your code. I would try to look more carefully into the specific code versions your different deployments are running.

No luck there. I’m running the same code. I’ve verified this with debugger. The thing is, that one instance of Cadence seems to ignore deviceNotFoundError field. It’s properly mapped from the activity (it’s put as true as activity result) but in the workflow it deserialized as false as activity result and it is not relfected at all in Cadence UI.

Does Cadence save any kind of metadata related to activities? Does it store the schema on the tasklists?

No, Cadence doesn’t store any metadata and treats all the payloads as opaque blobs. So the problem is clearly somewhere in the client.

Well. With debug session open I’m seeing that the activity result has this field present and set to true. Workflow worker get’s that same activity result field deserialized to false and not even visible in the Cadence UI. It doesn’t seem like client issue to me. Especially, that I’m able to run the same code on different instance of Cadence with no issue whatsoever.

I would recommend looking in the debugger at serialized activity output as well.

Yeah, I’ve checked the byte stream that is being sent to Cadence as the activity result and it contains that field set to true.

And the ActivityTaskCompletedEvent does not contain it? I just cannot imagine such situation.

Yes, ActivityTaskCompletedEvent does not contain it on one particular Cadence instance. I thought this might be related to domain, so I’ve created a new one, but same thing happened.