Log event ID on consumer errors (fixes #1714)
This commit is contained in:
parent
efc91146f0
commit
534c29ab02
|
@ -102,6 +102,7 @@ func (s *OutputRoomEventConsumer) onMessage(msg *sarama.ConsumerMessage) error {
|
||||||
default:
|
default:
|
||||||
// panic rather than continue with an inconsistent database
|
// panic rather than continue with an inconsistent database
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
|
"event_id": ev.EventID(),
|
||||||
"event": string(ev.JSON()),
|
"event": string(ev.JSON()),
|
||||||
"add": output.NewRoomEvent.AddsStateEventIDs,
|
"add": output.NewRoomEvent.AddsStateEventIDs,
|
||||||
"del": output.NewRoomEvent.RemovesStateEventIDs,
|
"del": output.NewRoomEvent.RemovesStateEventIDs,
|
||||||
|
|
|
@ -173,6 +173,7 @@ func (s *OutputRoomEventConsumer) onNewRoomEvent(
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// panic rather than continue with an inconsistent database
|
// panic rather than continue with an inconsistent database
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
|
"event_id": ev.EventID(),
|
||||||
"event": string(ev.JSON()),
|
"event": string(ev.JSON()),
|
||||||
log.ErrorKey: err,
|
log.ErrorKey: err,
|
||||||
"add": msg.AddsStateEventIDs,
|
"add": msg.AddsStateEventIDs,
|
||||||
|
@ -215,6 +216,7 @@ func (s *OutputRoomEventConsumer) onOldRoomEvent(
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// panic rather than continue with an inconsistent database
|
// panic rather than continue with an inconsistent database
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
|
"event_id": ev.EventID(),
|
||||||
"event": string(ev.JSON()),
|
"event": string(ev.JSON()),
|
||||||
log.ErrorKey: err,
|
log.ErrorKey: err,
|
||||||
}).Panicf("roomserver output log: write old event failure")
|
}).Panicf("roomserver output log: write old event failure")
|
||||||
|
@ -276,6 +278,7 @@ func (s *OutputRoomEventConsumer) onNewInviteEvent(
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// panic rather than continue with an inconsistent database
|
// panic rather than continue with an inconsistent database
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
|
"event_id": msg.Event.EventID(),
|
||||||
"event": string(msg.Event.JSON()),
|
"event": string(msg.Event.JSON()),
|
||||||
"pdupos": pduPos,
|
"pdupos": pduPos,
|
||||||
log.ErrorKey: err,
|
log.ErrorKey: err,
|
||||||
|
|
Loading…
Reference in a new issue