producer thread only sometimes running