Make generation of graph safe for concurrent access from web server