The sourcer can be directed to read the same file multiple times; it is also prone to infinite loops when scanning directories.
Some kind of concurrent hash table (e.g. via papaya) should be introduced into GlobalSourcer for deduplicating files and detecting loops; it should be accessible by path, and deduplicated by (st_dev_major, st_dev_minor, st_ino). This should be used for catching directory loops. If a file has been sourced before, future requests for it should return the existing contents (and a unique ID for caller-side deduplication). The token buffer cannot be cached at this level because it is edition-dependent.