All of lore.kernel.org
 help / color / mirror / Atom feed
* Filename too long
@ 2017-01-18 19:02 Mark Hatle
  2017-01-19  6:13 ` Robert Yang
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Hatle @ 2017-01-18 19:02 UTC (permalink / raw)
  To: bitbake-devel

I found a problem today working through a problem report.

We have a situation where we automatically add certain project directories as
premirrors within the environment.

During the fetch2 work, the system takes this long pathname, and then embeds it
into ud.lockfile parameter, we end up with something like:

The path to the build/download dir is about 250 characters... (abbreviated below)

ud.lockfile =
/my/really/log/path/to/my/project/build/download/git2/file....my.really.log.path.to.my.project.layers.wr-kernel.recipes-kernel.linux.......git.kernel-4.8.x.git.lock

This triggers an exception, IOError with the errno '36', and error string of
'File name too long'.  (Note, this is the filename, NOT the path being too long!)

In the bitbake/lib/bb/utils.py: def lockfile(name, shared=False, retry=True,
block=False)

The system tries to:

while True:
    try:
        lf = open(name, 'a+')
        ... more work here ...
    except Exception:
        ... close the file, if opened ...
        pass
    if not retry:
        return None

This triggers an endless loop if this happens.

So at a minimum we probably need to extend the exception handling to look for
file (or path) too long errors and return/stop.

I'm wondering if, something like the following should be added:

 exception IOError as e:
     errno, strerror = e.args
     logger.fatal("IOError on lock: [%s] %s" % (errno, strerror))
     try:
         lf.close()
     except Exception:
         pass
     retry = False
     pass

(Is stopping on all IOErrors too broad of a check?)


Second, I'm not sure where the lockfile name is determined, but should there be
a way in there to shorten the lockfile to say the 'basename' instead of a full
path (if specified)?

Any suggestions would be appreciated.

--Mark


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-19 16:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-18 19:02 Filename too long Mark Hatle
2017-01-19  6:13 ` Robert Yang
2017-01-19 10:21   ` Richard Purdie
2017-01-19 15:07     ` Mark Hatle
2017-01-19 16:05       ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.