Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow process instance data unavailable in Indexer enrichment call #619

Open
subhashini-egov opened this issue Nov 22, 2024 · 0 comments

Comments

@subhashini-egov
Copy link
Contributor

subhashini-egov commented Nov 22, 2024

Steps to reproduce:

  1. Service calls workflow transition for the first time
  2. Service pushes data to Kafka topic
  3. Indexer listens to Kafka topic and attempts enrichment of Workflow by calling search API

Issue:

Workflow search returns empty.

Reason:

Workflow persists its data in an async fashion. Before Workflow data is persisted to the DB, Indexer makes the call to the service looking for the data. This is a timing issue.

Fix:

  1. Implement Redis caching in Workflow and return data from the cache if data is not present in DB. Cache invalidation should be implemented correctly to avoid stale data.
  2. Make the workflow service synchronous and persist directly in DB instead of via persister. This will ensure all data is in the DB as soon as the transition call is made.

Additional Context:

  1. This issue has been commonly observed in MUKTA, DRISTI (Pucar) and SELCO usage of the DIGIT platform.
  2. This is not always reproducible. Certain services calling WF have this problem while some others work just fine.
  3. As a workaround, services do the workflow enrichment in code and avoid doing it in Indexer. This leads to writing a lot of extra code in multiple places.

@talele08 @eGovMan @GhanshyamRawat-eGov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant