hg serve keeps crashing with "bad file descriptor" in book.pyo
Jaap Sperling
jsperling at controll-it.de
Wed Nov 21 06:05:43 UTC 2012
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 20/11/2012 21:11, Matt Mackall wrote:
> On Tue, 2012-11-20 at 07:19 +0100, Jaap Sperling wrote:
>> On 20/11/2012 06:59, Matt Mackall wrote:
>>> On Mon, 2012-11-19 at 23:02 +0100, Jaap Sperling wrote:
>>>> After running quite happily for a couple of months, our
>>>> Mercurial "server" has suddenly become really unstable. About
>>>> 2 or 3 times a day it suddenly started crashing.
>>>
>>> It probably coincided with someone configuring a new hook.
>>> Your server's WSGI implementation appears to be hostile to our
>>> hook IO redirection code. Interesting... what are you using?
>>
>> Sorry, forgot to mention that this behaviour started under a
>> previous version, which was 2.1.x iirc; I forgot to note that as
>> the first thing I did was upgrade to the latest version coming
>> with TortoiseHg. I raised the issue with them first (issue #2273
>> on THG's bitbucket), but they redirected me here.
>>
>> I simply open a command box and type hg serve --web-conf
>> hgweb.config from the directory containing our repos. All the
>> hgweb.config file contains is a [paths] section with 'alias =
>> path_to_repo' entries.
>>
>>
>>>
>>>> C:\Users\Mercurial>hg --version Mercurial Distributed SCM
>>>> (version 2.3.2)
>>>
>>> That was released Oct 1 (not yet months).
>>>
>>>> File "mercurial\hook.pyo", line 154, in hook OSError: [Errno
>>>> 9] Bad file descriptor
>>>
>>> This code prevents hooks from writing to stdout, etc. as
>>> that's prone to causing protocol issues. WSGI servers often
>>> have dummy file objects here, but yours seems to have bogus
>>> file descriptors instead that bypass our checks:
>>>
>>> stdoutno = sys.__stdout__.fileno() stderrno =
>>> sys.__stderr__.fileno() # temporarily redirect stdout to
>>> stderr, if possible if stdoutno >= 0 and stderrno >= 0:
>>> sys.__stdout__.flush() -> oldstdout = os.dup(stdoutno)
>>>
>>> ..and this only gets run for hooks. In this case, seems to be
>>> a listkeys hook.
>>>
>>
>> I am the 'admin' for the server and I cannot remember installing
>> any hooks (I looked for one to support notifying TeamCity servers
>> but hadn't found one yet). Here the content (edited to obfuscate)
>> of the Mercurial.ini file.
>>
>> # Generated by TortoiseHg settings dialog [web] push_ssl = False
>> allow_push = *
>>
>> [smtp] host = <smtp_host> port = 25 tls = True username =
>> <smtp_username> password = <smtp_password> local_hostname =
>> <local_hostname>
>>
>> [email] from = <email_address> to = <internal_distribution_list>
>> method = smtp
>>
>> [extensions] graphlog =
>>
>> [tortoisehg] defaultpush = all
>>
>> [http_proxy] host = <proxy_host_ip_and_port> no =
>> <some_exclusions>
>>
>>
>> Are there any other places hooks could be installed?
>
> Try:
>
> hg showconfig hooks --debug
>
The files listed through that command are either standard TortoiseHg
files which are unmodified (and contain nothing resembling 'hooks')
and the Mercurial.ini reproduced above.
The output of hg showconfig only contains the content of the
Mercurial.ini plus settings for diffing and mergetools
- --
Jaap A. Sperling MA MBCS
Senior Software Developer
Controllit AG
Stresemannstrasse 342
D-22761 Hamburg/Germany
Tel.: +49 (0)40 / 89 06 64 75
Fax.: +49 (0)40 / 89 06 64 69
Sitz und Registergericht/Domicile and Country of Registry:
Hamburg, HRB-Nr. 124406
Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board:
Rolf M. Freiherr von Rössing
Vorstand/Board of Management:
Matthias Rosenberg
www.controll-it.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
iEYEARECAAYFAlCsbzYACgkQIV2+BFYEoM/VswCfYWN/3W3mCqy1e5Cycf+kSH78
14AAnjs+dQ+0OyZr7ZLK57MAzDMBkH1Z
=9LNs
-----END PGP SIGNATURE-----
More information about the Mercurial
mailing list