Clearing Cache in Temporal

Hi,

I am using Temporal Java SDK. Sometime the logs added in Activity methods doesnt display in the console.

But when i see the Temporal UI, i see the activities got execute.

Can someone please help. Also i there a way to clear cache in Temporal server

Hi @Faizan_Kamal, what SDK and version are you using? Were you able to debug to make sure that the logging code in your activities is executed when you say it’s not showing?

What do you mean with clear server cache? Do you mean in development env (Docker-compose)?

Hi,

I am using Java SDK 1.7.0

Issue which i am facing is for some activities, attempt number from Activity Execution context is coming as 2 though its getting executed for first time.

It should come as 1

Please let me know what can we do from our end.

Can you show your activity code where you are calling

Activity.getExecutionContext().getInfo().getAttempt()

(seeing the workflow history would help as well)

My initial guess would be that you are assigning it to a class variable maybe? Note that you are registering a single activity implementation with the worker which is reused so it would be best to call this method every time inside your activity method code.

Also note that workflow history does not show every activity retry attempt (to keep the history smaller in case you have a ton of retries), so let’s say that your activity retried 4 times and on the 4th attempt it succeeded, in history you will just see a single
ActivityTaskStarted event with attempt property set to 4.
This event also has a lastFailure property which will give you the failure of the last performed activity exec.

An activity task can be lost before starting execution. For example, if an activity worker or Temporal frontend crashes while it is being delivered. In this case, a task is retried and an attempt can be more than one on the first actual execution.