Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
ignore attachment conflicts for now, problem with cloudant
Browse files Browse the repository at this point in the history
  • Loading branch information
ddollar committed Jan 14, 2012
1 parent ba6ddc8 commit 2239733
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ app.post('/make', function(request, response, next) {
'application/octet-stream',
fs.createReadStream(files.code.path),
function(err, data) {
if (err) { log_error(id, util.inspect(err)); return next(err); }
if (err) {
// work around temporary problem with cloudant and document
// conflicts
if (err.error != 'conflict') {
log_error(id, err.reason);
return next(err.reason);
}
}

// spawn bin/make with this build id
log_action(id, 'spawning build');
Expand Down

3 comments on commit 2239733

@jshepard
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does doc.put_attachment in bin/make need a similar workaround?

@ddollar
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like that is already retrying on conflict

@jshepard
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fairly ruby illiterate, but it looks like it retries by attempting to save the attachment again (presumably with the document version id it got from db.get(id) ), if the failure is due to a race condition in the big couch back end, and the put_attachement actually worked (and the version was updated to 3-xxx) then won't these subsequent retries always fail?

Please sign in to comment.