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

runMigrationSilent is not threadsafe #966

Closed
NorfairKing opened this issue Oct 7, 2019 · 2 comments
Closed

runMigrationSilent is not threadsafe #966

NorfairKing opened this issue Oct 7, 2019 · 2 comments

Comments

@NorfairKing
Copy link
Contributor

NorfairKing commented Oct 7, 2019

Example errors:

/dev/null: hDuplicateTo: resource busy (Device or resource busy)
<stderr>: hDuplicateTo: resource busy (Device or resource busy)

This is because of the call to hSilence [stderr] which is not threadsafe.
This call was added in response to #105 because of the way the postgres backend works.
I'm using sqlite, and with that call removed in #965, everything "Just works":tm: but that doesn't solve the problem for postgres.
#105 mentions that you can silence postgres by setting PGOPTIONS to --client-min-messages=warning.

So a few options:

  • Leave runMigrationSilent non-threadsafe. Then I'll use runMigration and just get a bunch of nonsense output:
    welsh
  • Split runMigrationSilent into a version that uses hSilence and one that doesn't.
  • Remove the call to hSilence and instruct postgres users to set PGOPTIONS accordingly.

I'm in favour of the second, with some good docs.
I could do that as part of #965

merijn added a commit to merijn/persistent that referenced this issue Oct 11, 2019
parsonsmatt pushed a commit that referenced this issue Oct 11, 2019
… broken runMigrationSilent (#971)

* Add safer *Quiet variations of runMigrationSilent

This commit fixes/provides workarounds for: #474, #640, #948, and #966.

* Fix stupid typos in initial patch

* Update ChangeLog with PR number
@parsonsmatt
Copy link
Collaborator

Fixed by #971

@NorfairKing
Copy link
Contributor Author

Wonderful!

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

2 participants