flow-hydraulics / flow-pds

This repository is currently not maintained
4 stars 8 forks source link

Failed to handle concurrent `CreateDistribution` requests #132

Open judezhu opened 3 years ago

judezhu commented 3 years ago

The issue we have been seeing here is if we are sending multiple CreateDistribution requests to PDS backend service. The PDS backend service will fail to record the state of the distribution and pack nfts.

How to reproduce:

  1. Mint some example MFTs and mint a distribution onchain.
  2. Send createDistribution request via the rest API.
  3. Before the distribution is completed, send another createDistribution request right away.

What results we have seen:

  1. In distributions table, the distributions created by the concurrent requests will be stuck at minting state.
  2. In the distribution_packs table, the packs will be stuck at init state, although the PackNFTs are minted on-chain.