This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

ignore attachment conflicts for now, problem with cloudant

  • Loading branch information...
ddollar committed Jan 14, 2012
1 parent ba6ddc8 commit 2239733bca9f051c5da27ac4b713dd8b3de0082d
Showing with 8 additions and 1 deletion.
  1. +8 −1 server/web.js
View
@@ -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');

3 comments on commit 2239733

@jshepard

This comment has been minimized.

Show comment
Hide comment
@jshepard

jshepard Jan 14, 2012

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

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

@ddollar

This comment has been minimized.

Show comment
Hide comment
@ddollar

ddollar Jan 14, 2012

Contributor

Looks like that is already retrying on conflict

Contributor

ddollar replied Jan 14, 2012

Looks like that is already retrying on conflict

@jshepard

This comment has been minimized.

Show comment
Hide comment
@jshepard

jshepard Jan 14, 2012

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?

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.