Activity Timeout and Temporal server connectivity issue

The most probable cause for this error is that the activity worker reports completion status after the activity task timed out on the server side. An activity timeout does not forcibly stops execution of the activity code.

For example, let’s suppose that activity SomeVeryLongActivity is scheduled with a start-to-close timeout of 10 seconds, but sometime takes more than 20 seconds to complete. In that case, the activity code will continue executing after the 10 seconds timeout, but when the activity’s completion gets reported (after 20 seconds), then the server will refuse it, as the activity task token is not longer valid.

Possible solutions to this are:

  • Increase the timeout constraints on your activities (start-to-close and/or schedule-to-close)
  • Send heartbeats from your activity