SN-10106 附来源、原文与上下文。
linux-0.1.6-test5 解决了 Liberty 的僵尸套接字问题。MSG_DONTWAIT 修复了根本原因,不需要终止并重启线程。套接字原本已经标记为非阻塞,所以我不明白为什么。也许它忘了。我想,如果套接字失败,操作系统将其关闭,就没有东西能记住它曾经是非阻塞的;但访问已关闭的句柄,应该立即返回错误。Windows 上没有 MSG_DONTWAIT,唯一办法是把套接字标记为非阻塞,所以如果有人在 Wine 中运行 Windows 版,就只能依靠终止线程。
linux-0.1.6-test5 solved Liberty's zombie socket problem. The MSG_DONTWAIT fixed the root cause, it's not having to terminate and restart the thread. The sockets are marked non-blocking already, so I don't understand why. Maybe it forgot. I suppose if a socket fails and the OS closes it then there's nothing left to remember it was non-blocking, but then accessing a closed handle should return immediately with an error. There's no MSG_DONTWAIT on Windows, marking the socket as nonblocking is the only way, so if anyone runs the Windows version in Wine it will have to rely on terminating the thread.
现在唯一的问题,是他遇到的数据库异常。
The only problem now is the DB exceptions he's getting.
EXCEPTION: 11DbException
Db::open: Bad file descriptor
bitcoin in ThreadMessageHandler()
************************
EXCEPTION: 11DbException
Db::close: Bad file descriptor
bitcoin in ThreadMessageHandler()
EXCEPTION: 11DbException
Db::open: Bad file descriptor
bitcoin in ThreadMessageHandler()
************************
EXCEPTION: 11DbException
Db::close: Bad file descriptor
bitcoin in ThreadMessageHandler()
我原以为这些是 Wine 的问题,但他在 Linux 上也同样遇到了。他尝试把 datadir 移到另一块硬盘上,没有帮助。我从未遇到过。我运行着压力测试,持续产生大量活动和数据库访问,也从未出现。
I had expected those to be a Wine problem, but he's getting them on Linux just the same. He tried moving the datadir to a different drive, no help. I've never gotten them. I'm running a stress test that continuously generates a lot of activity and DB access and never got it.
他用 64 位 Ubuntu,我用 32 位,所以我猜区别就在这里。你的 Linux 机器是 64 位还是 32 位?你有没有遇到过数据库异常?(也看看 db.log。)现在 test5 已经解决僵尸问题,你能开始在 Linux 机器上运行它吗?我们需要第三份结果,更好地了解正在面对什么问题。数据库异常没有被捕获,所以如果遇到,程序就会停止。
He has Ubuntu 64-bit and I have 32-bit, so I'm assuming that's the difference. Is your Linux machine 64-bit or 32-bit? Have you ever had a DB exception? (see db.log also) Now that the zombie problem is fixed in test5, could you start running it on your Linux machine? We could use a 3rd vote to get a better idea of what we're dealing with here. The DB exception is uncaught, so it'll stop the program if you get it.
顺便说一下,Zetaboards 非要显示“会员编号”,所以你最好早点注册,抢个好账号号码。
BTW, zetaboards insists on displaying "Member #", so you better sign up soon and grab a good account number.