question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Observed Concurrency in Mutation

See original GitHub issue
  • What is the current behavior? When I create mutations, I observe that mutations run concurrently. (which ruins my database)

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via a github repo, https://repl.it or similar. I have created mutation like this

schema = graphene.Schema(query=Query, mutation=Mutation, auto_camelcase=True)
class Mutation(graphene.ObjectType):
    test = TestMutation.Field()
class TestMutation(graphene.Mutation):
    class Arguments:
        uuid = graphene.String(required=True)
        ... and more ...

    vocab_id = graphene.String()
    ... and more ...

    @staticmethod
    @mutation_jwt_required
    def mutate(parent, info, **kwargs):
        print("Enter mutation")

        ... code containing database modification and access ...
        ... race condition is detected here (enter mutation twice without exiting) ...

        print("Exit mutation")
        return TestMutation(...)
  • What is the expected behavior? According to GraphQL documentation, the mutation is run in sequential execution.

  • What is the motivation / use case for changing the behavior? I wonder if this behavior is intended.

  • Please tell us about your environment:

    • Version:
  - flask=1.1.2
  - flask-sqlalchemy=2.4.4
  - numpy=1.20.0
  - pandas=1.2.1
  - pip=20.3.3
  - python=3.7.3
  - sqlalchemy=1.3.22
  - sqlite=3.34.0
  - pip:
    - flask-graphql==2.0.1
    - flask-graphql-auth==1.3.2
    - graphene==2.1.8
    - graphql-core==2.3.2
    - graphql-relay==2.0.1
    - graphql-server-core==1.2.0
  • Platform: Ubuntu 18.04
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
KokeCacaocommented, Aug 21, 2021

Sequential means that if a mutation operation has multiple mutations in it then each will be executed after each other (which is different to a regular query where each field might be executed in parallel).

For example with this operation:

mutation {
  test() { success }
  anotherMutation() { success }
}

The test mutation will execute before anotherMutation.

Does that make sense?

Yes. It makes perfect sense. Thank you so much!

0reactions
jkimbocommented, Aug 21, 2021

Sequential means that if a mutation operation has multiple mutations in it then each will be executed after each other (which is different to a regular query where each field might be executed in parallel).

For example with this operation:

mutation {
  test() { success }
  anotherMutation() { success }
}

The test mutation will execute before anotherMutation.

Does that make sense?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Concurrent mutations of coding and regulatory sequences of ...
This report concerns the study of Ha-ras gene mutations and ras p21 ... (65%) than in grade II (44%) tumors; no mutations were...
Read more >
Distinct mutational signatures characterize concurrent loss of ...
In a follow-up study, concurrent to our own, the mutational spectra observed in a large number of adult tumors were clustered, revealing that...
Read more >
Concurrent and mutual exclusion of mutations observed ...
Concurrent and mutual exclusion of mutations observed across genes in lung adenocarcinomas.Tumours with and without mutations in the indicated genes are ...
Read more >
Concurrent Mutations Functionally Relevant | Cancer Discovery
These mutations preferentially occurred in certain genes, including PIK3CA in breast cancers, APC in colorectal cancers, CDK12 in prostate ...
Read more >
Concurrent mutations of germline GPR101 and somatic USP8 ...
A quick weight gain and slow growth were also observed. ... ACTH adenoma and pointed out that unusual concurrent mutations might contribute ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found