Skip to content

make initdb slows to a crawl/fails when docker-compose is compose v2 #10772

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

Closed
woodruffw opened this issue Feb 17, 2022 · 11 comments
Closed

make initdb slows to a crawl/fails when docker-compose is compose v2 #10772

woodruffw opened this issue Feb 17, 2022 · 11 comments
Labels

Comments

@woodruffw
Copy link
Member

Noticed this while trying to stand up a local instance of Warehouse with compose v2 enabled:

Observed behavior:

  1. Running make initdb produces much more output on the terminal than it normally does

  2. The console scrollback for the db service is filled with lots of SQL syntax errors, e.g.:

    warehouse-db-1             | 2022-02-17 17:02:49.596 UTC [35] ERROR:  syntax error at or near "0.0" at character 1
    

I let make initdb run for about ~5 minutes, which is several times longer than it takes to complete when using compose v1, without visible progress beyond the initial SQL load phase.

Reproduction steps:

These steps are for macOS.

  1. Open up the Docker for Mac preferences pane (Cmd + ,)
  2. Go to the "General" page
  3. Click the checkbox for "Use Docker Compose V2" (screenshot below)
  4. Restart the Docker daemon
  5. make serve
  6. make initdb (in a separate window)

Screen Shot 2022-02-17 at 12 13 08 PM

@di
Copy link
Member

di commented Feb 17, 2022

Are you able to narrow down which of the make initdb commands is the source of the error?

https://github.com/pypa/warehouse/blob/968f11fe99b2e0eba6c833250dc1e007a208cd33/Makefile#L142-L149

I'm guessing it's probably this one:

https://github.com/pypa/warehouse/blob/968f11fe99b2e0eba6c833250dc1e007a208cd33/Makefile#L146

@di
Copy link
Member

di commented Feb 17, 2022

Parts of #9993 might be a potential solution for this.

@woodruffw
Copy link
Member Author

Yep, it's that one. My guess is that compose V2 has broken/buggy pipe behavior, since that's been a consistent problem across docker and docker-compose over the years.

@woodruffw
Copy link
Member Author

Parts of #9993 might be a potential solution for this.

I can give that changeset a try in a moment!

@miketheman
Copy link
Member

If the pipe behavior is the culprit, did this fix it? #10978

@woodruffw
Copy link
Member Author

If the pipe behavior is the culprit, did this fix it? #10978

I'll re-try this afternoon and find out.

@di
Copy link
Member

di commented Apr 13, 2022

@woodruffw Have you been able to determine if this is resolved?

@woodruffw
Copy link
Member Author

Sorry, this fell off my radar! Trying now (as soon as Docker Desktop finishes updating...)

@woodruffw
Copy link
Member Author

It appears to be working now! I see this in my logs:

warehouse-db-1             | 2022-04-13 22:40:19.421 UTC [39] FATAL:  terminating connection due to administrator command
warehouse-db-1             | 2022-04-13 22:40:19.421 UTC [40] FATAL:  terminating connection due to administrator command
warehouse-db-1             | 2022-04-13 22:40:34.177 UTC [60] FATAL:  role "root" does not exist

...but Warehouse does appear to come up correctly and the commands all still exit successfully. Closing.

@miketheman
Copy link
Member

For that last message, I've supplied #11182 to fix it.

@woodruffw
Copy link
Member Author

woodruffw commented Apr 14, 2022 via email

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

No branches or pull requests

3 participants