mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-26 15:08:28 +00:00
Apply backpressure to consumers/synchronous requests to hopefully stop things being overwhelmed
This commit is contained in:
parent
5ed90caaff
commit
c68037b3e8
1 changed files with 4 additions and 2 deletions
|
@ -77,7 +77,8 @@ func (r *Inputer) Start() error {
|
|||
return
|
||||
}
|
||||
roomserverInputBackpressure.With(prometheus.Labels{"room_id": roomID}).Inc()
|
||||
r.workerForRoom(roomID).Act(nil, func() {
|
||||
worker := r.workerForRoom(roomID)
|
||||
worker.Act(worker, func() {
|
||||
defer roomserverInputBackpressure.With(prometheus.Labels{"room_id": roomID}).Dec()
|
||||
if err := r.processRoomEvent(context.TODO(), &inputRoomEvent); err != nil {
|
||||
sentry.CaptureException(err)
|
||||
|
@ -133,7 +134,8 @@ func (r *Inputer) InputRoomEvents(
|
|||
inputRoomEvent := e
|
||||
roomID := inputRoomEvent.Event.RoomID()
|
||||
roomserverInputBackpressure.With(prometheus.Labels{"room_id": roomID}).Inc()
|
||||
r.workerForRoom(roomID).Act(nil, func() {
|
||||
worker := r.workerForRoom(roomID)
|
||||
worker.Act(worker, func() {
|
||||
defer roomserverInputBackpressure.With(prometheus.Labels{"room_id": roomID}).Dec()
|
||||
err := r.processRoomEvent(ctx, &inputRoomEvent)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue