-
Notifications
You must be signed in to change notification settings - Fork 643
Closed
Labels
api: loggingIssues related to the Cloud Logging API.Issues related to the Cloud Logging API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Two successive calls to Log.prototype.write should preserve the order of the log entries, as written to the Logging service. I am noticing my log entries showing up out of order.
I think the problem is due to the async behaviour in Log.prototype.decorateEntries_:
Log.prototype.decorateEntries_ = function(entries, callback) {
var self = this;
async.map(entries, function(entry, callback) {
if (!(entry instanceof Entry)) {
entry = self.entry(entry);
}
var decoratedEntry = entry.toJSON();
decoratedEntry.logName = self.formattedName_;
self.metadata_.assignDefaultResource(decoratedEntry, function(err, entry) {
// Ignore errors (the API will speak up if it has an issue).
callback(null, entry || decoratedEntry);
});
}, callback);
};Two successive calls to the above, within the timer resolution of JavaScript Date.now() (i.e. having the same timestamp), may get written to the network out of order depending on which log entry gets called back first from assignDefaultResource.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: loggingIssues related to the Cloud Logging API.Issues related to the Cloud Logging API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.