dipdup-io / dipdup

Modular framework for creating selective indexers and featureful backends for dapps
https://dipdup.io
MIT License
97 stars 52 forks source link

Indexes spawned at runtime don't start automatically (7.0.0rc2) #767

Closed TristanAllaire closed 1 year ago

TristanAllaire commented 1 year ago

Steps to reproduce: Everything is on Tezos. I have a template defined in my dipdup.yml that I use in a handler. To use this template, I call the ctx.add_index() function. I didn't change the implementation of this function from 6.5.9 to 7.0.0rc2. The newly created index only starts when I restart the indexing (by using CTRL+C & dipdup run). I think it was properly added in the DB as a new index but it isn't executed automatically.

What did you expect to happen: The new index runs and the operations start to get indexed

What actually happened: Nothing happen. The handler doesn't crash but the index doesn't start. However, the newly created index (with ctx.add_index()) starts when I restart the indexer (CTRL+C & dipdup run)

Environment

droserasprout commented 1 year ago

Hi! Currently, indexes from ctx.add_index start on the next synchronization loop. Have your "parent" index reached realtime before you've restarted the indexer?

TristanAllaire commented 1 year ago

Hi! I think yes! I'm starting a huge template from a single index which is a contract origination. When the origination is done, I should reach realtime but the index won't start

TristanAllaire commented 1 year ago

Sorry @droserasprout my bad, actually I think it works. I just don't see the logs anymore. I didn't know the logging changed in version 7.0.0.

edit: actually it works only when I restart the indexer manually even if I see less logs compared to version 6. If I wait for the dynamic index to work automatically, it still doesn't work.

droserasprout commented 1 year ago

Am I understanding correctly that runtime indexes not start in your case even after config-defined ones has reached realtime state? Also, opened #770 and #771 to improve clarity.

TristanAllaire commented 1 year ago

Yes that's what's happening

TristanAllaire commented 1 year ago

Actually I just retested it now and this time, the runtime index won't run even if I restart manually and even if my config-defined one reached realtime

droserasprout commented 1 year ago

Thanks, gonna investigate.

droserasprout commented 1 year ago

Fixed in #784