|
@@ -223,7 +223,7 @@ class EventManager(object):
|
|
|
return data
|
|
|
|
|
|
@suppress_exceptions
|
|
|
- @transaction.commit_on_success
|
|
|
+ @transaction.atomic
|
|
|
def save(self, project, raw=False):
|
|
|
# TODO: culprit should default to "most recent" frame in stacktraces when
|
|
|
# it's not provided.
|
|
@@ -317,23 +317,18 @@ class EventManager(object):
|
|
|
|
|
|
# save the event unless its been sampled
|
|
|
if not is_sample:
|
|
|
- sid = transaction.savepoint(using=using)
|
|
|
try:
|
|
|
- event.save()
|
|
|
+ with transaction.atomic():
|
|
|
+ event.save()
|
|
|
except IntegrityError:
|
|
|
- transaction.savepoint_rollback(sid, using=using)
|
|
|
return event
|
|
|
- transaction.savepoint_commit(sid, using=using)
|
|
|
|
|
|
- sid = transaction.savepoint(using=using)
|
|
|
try:
|
|
|
- EventMapping.objects.create(
|
|
|
- project=project, group=group, event_id=event_id)
|
|
|
+ with transaction.atomic():
|
|
|
+ EventMapping.objects.create(
|
|
|
+ project=project, group=group, event_id=event_id)
|
|
|
except IntegrityError:
|
|
|
- transaction.savepoint_rollback(sid, using=using)
|
|
|
return event
|
|
|
- transaction.savepoint_commit(sid, using=using)
|
|
|
- transaction.commit_unless_managed(using=using)
|
|
|
|
|
|
if not raw:
|
|
|
post_process_group.delay(
|
|
@@ -446,10 +441,6 @@ class EventManager(object):
|
|
|
else:
|
|
|
is_regression = False
|
|
|
|
|
|
- # We need to commit because the queue can run too fast and hit
|
|
|
- # an issue with the group not existing before the buffers run
|
|
|
- transaction.commit_unless_managed(using=group._state.db)
|
|
|
-
|
|
|
# Determine if we've sampled enough data to store this event
|
|
|
if is_new:
|
|
|
is_sample = False
|
|
@@ -458,6 +449,10 @@ class EventManager(object):
|
|
|
else:
|
|
|
is_sample = True
|
|
|
|
|
|
+ # We need to commit because the queue can run too fast and hit
|
|
|
+ # an issue with the group not existing before the buffers run
|
|
|
+ transaction.commit(using=group._state.db)
|
|
|
+
|
|
|
# Rounded down to the nearest interval
|
|
|
safe_execute(Group.objects.add_tags, group, tags)
|
|
|
|
|
@@ -491,7 +486,7 @@ class EventManager(object):
|
|
|
active_at__gte=date - timedelta(seconds=5),
|
|
|
).update(active_at=date, status=GroupStatus.UNRESOLVED))
|
|
|
|
|
|
- transaction.commit_unless_managed(using=group._state.db)
|
|
|
+ transaction.commit(using=group._state.db)
|
|
|
|
|
|
group.active_at = date
|
|
|
group.status = GroupStatus.UNRESOLVED
|