[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#671721: libapt-pkg4.12: pkgAcquire::Worker::OutFdReady() fails after write() fails with EAGAIN



On 6 May 2012 17:57, YOSHINO Yoshihito <yy.y.ja.jp@gmail.com> wrote:
> By bisecting changes in the bzr repository I found this problem is
> caused by a commit revision 2129.55.33 "use a static FileFd::Write
> overload to reduce duplication of write()-retry code".
>
> More specifically, replacing the loop in function
> pkgAcquire::Worker::OutFdReady with a call to FileFd::Write causes the
> behavior. Previously, this function tries a single write() call against
> file descriptor OutFd, trims OutQueue and returns true. The current
> version calls FileFd::Write, which issues write() repeatedly until the
> request finishes. This write() fails with errno EAGAIN after a
> successful write of 65536 bytes, which suggests the size of the buffer
> of a pipe OutFd points to.
>

Thank you for tracking this down.

This happens because Worker is dumping the configuration and the
aptitude-defaults.LANG contains large amounts of data for some
locales.  Other large amounts of config would cause the same problem.

Regardless, it seems like FileFd::Write in it's current form is not
suitable for the non-blocking IO used in OutFdReady.

> An attached patch simply reverts pkgAcquire::Worker::OutFdReady to its
> 0.8.16~exp13 version.

Works for me.



Reply to: