Clement Emmanuel
05/18/2023, 1:09 AMdagster._core.errors.DagsterUserCodeUnreachableError: The sensor tick timed out due to taking longer than 60 seconds to execute the sensor function. One way to avoid this error is to break up the sensor work into chunks, using cursors to let subsequent sensor calls pick up where the previous call left off.
These sensors aren't particularly complex, they're mostly a copy/paste of this example, so i'm not sure why they're taking so long to execute. My dagster-daemon is running on a pod with 8cpu and 16gb memory maybe it's just under-provisioned?dagster dev -m #module
Something of note, our Definitions
takes some time to build, is it possible this is being re-built every time?context.latest_materialization_records_by_partition_and_asset()
Is actually pretty inefficient, and can take a good amount of time to execute just by itself, let alone any other logic you might be trying to run in the sensor tick invocationVitaly Markov
05/23/2023, 5:03 AMClement Emmanuel
05/23/2023, 3:02 PM.get_asset_records
and get_partition_counts
methods of? I don't see them on a MultiAssetSensorEvaluationContext
or a regular SensorEvaluationContext
What asset_graph methods you referring to, i'm assuming there are some utilities I can use to do basic dag filtering operations on an asset graph as defined in the code location Definitions
object.Vitaly Markov
05/23/2023, 3:28 PMcontext.repository_def.asset_graph
context.instance.get_asset_records()
partitioned_asset_keys = [asset_key for asset_key in self.asset_graph.all_asset_keys if self.asset_graph.is_partitioned(asset_key)]
context.instance.get_materialization_count_by_partition(partitioned_asset_keys)
context
.