Skip to content

fix(client): iTX - disable pipelining for http pool for binary engine - #10295

Merged
Jolg42 merged 4 commits into
mainfrom
fix/itx
Nov 17, 2021
Merged

Jolg42 merged 4 commits into
mainfrom
fix/itx

Conversation

@millsp

@millsp millsp commented Nov 16, 2021 •

Copy link
Copy Markdown
Contributor

fixes #8707

if (this._pool) return

this._pool = new Pool(url, {
connections: 100,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:

  • We instantiated up to 100 Clients
  • With each socket sending up to 10 requests

this._pool = new Pool(url, {
connections: 100,
pipelining: 10,
connections: 1000,

@millsp millsp Nov 16, 2021 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After:

  • We instantiate up to 1000 Clients
  • With each socket sending up to 1 requests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(discussed with Dom, not an issue)

@millsp millsp added this to the 3.6.0 milestone Nov 16, 2021

this._pool = new Pool(url, {
connections: 100,
pipelining: 10,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for this change is that we cannot pipeline requests. In other words, we cannot make requests serial. Why? Because if you have - for instance - a transaction A that blocks on B, transaction B will never finish (as the http client waits for a response from the QE on transaction A).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think pipelining was added to have better performance, probably we didn't have transactions implemented at that time.

@millsp
millsp marked this pull request as ready for review November 16, 2021 23:59
@millsp
millsp requested a review from Jolg42 as a code owner November 16, 2021 23:59
@Jolg42
Jolg42 requested a review from aqrln November 17, 2021 12:05
@Jolg42 Jolg42 changed the title fix(client): iTX fix(client): iTX - disable pipelining for http pool for binary engine Nov 17, 2021

@Jolg42 Jolg42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@aqrln aqrln left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@aqrln

aqrln commented Nov 17, 2021

Copy link
Copy Markdown
Member

Restarted the CI because of an unrelated failure (generator test timed out).

  ● using cli › should work with a custom generator
726

727
    thrown: "Exceeded timeout of 30000 ms for a test.
728
    Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
729

730
      26 |   })
731
      27 |
732
    > 28 |   it('should work with a custom generator', async () => {
733
         |   ^
734
      29 |     ctx.fixture('custom-generator')
735
      30 |     const data = await ctx.cli('generate')
736
      31 |
737

738
      at src/__tests__/commands/Generate.test.ts:28:3
739
      at Object.<anonymous> (src/__tests__/commands/Generate.test.ts:7:1)
740

@Jolg42

Jolg42 commented Nov 17, 2021

Copy link
Copy Markdown
Contributor

@aqrln not sure why but it's extra flaky these last days

@Jolg42
Jolg42 merged commit 28a7f97 into main Nov 17, 2021
@Jolg42
Jolg42 deleted the fix/itx branch November 17, 2021 15:21
@aqrln

aqrln commented Nov 17, 2021

Copy link
Copy Markdown
Member

@Jolg42 yeah, not sure if I've seen exactly this one or some other tests failing with timeout like that lately, but the error looks very familiar.

rayjohnson1 added a commit to rayjohnson1/docs that referenced this pull request Nov 20, 2021
Is this section able to be removed now? I came across this and was confused as to whether or not it was fixed until I read through the related PRs and saw that it was resolved.

Initial GH Issue: prisma/orm#8707
Related PR: prisma/orm#10295
matthewmueller pushed a commit to prisma/web that referenced this pull request Nov 23, 2021
Is this section able to be removed now? I came across this and was confused as to whether or not it was fixed until I read through the related PRs and saw that it was resolved.

Initial GH Issue: prisma/orm#8707
Related PR: prisma/orm#10295
matthewmueller pushed a commit to prisma/web that referenced this pull request Jul 22, 2022
Is this section able to be removed now? I came across this and was confused as to whether or not it was fixed until I read through the related PRs and saw that it was resolved.

Initial GH Issue: prisma/orm#8707
Related PR: prisma/orm#10295
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

Successfully merging this pull request may close these issues.

interactiveTransactions: 2 concurrent writes to the same row will cause it to hang until expiring

3 participants