mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 19:33:09 -06:00
Increase timeouts for testing, observe contexts before trying to join over more servers
This commit is contained in:
parent
23896d6aa8
commit
029e750e1e
|
|
@ -16,7 +16,6 @@ package producers
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/matrix-org/dendrite/roomserver/api"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
|
|
@ -64,11 +63,6 @@ func (c *RoomserverProducer) SendEventWithState(
|
|||
return err
|
||||
}
|
||||
|
||||
fmt.Println("OUTLIERS")
|
||||
for _, v := range outliers {
|
||||
fmt.Println("*", v.EventID(), v.Type())
|
||||
}
|
||||
|
||||
var ires []api.InputRoomEvent
|
||||
for _, outlier := range outliers {
|
||||
ires = append(ires, api.InputRoomEvent{
|
||||
|
|
|
|||
|
|
@ -290,7 +290,15 @@ func (r joinRoomReq) joinRoomUsingServers(
|
|||
// There was a problem talking to one of the servers.
|
||||
util.GetLogger(r.req.Context()).WithError(lastErr).WithField("server", server).Warn("Failed to join room using server")
|
||||
// Try the next server.
|
||||
continue
|
||||
if r.req.Context().Err() != nil {
|
||||
// The request context has expired so don't bother trying any
|
||||
// more servers - they will immediately fail due to the expired
|
||||
// context.
|
||||
break
|
||||
} else {
|
||||
// The request context hasn't expired yet so try the next server.
|
||||
continue
|
||||
}
|
||||
}
|
||||
return *response
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ package main
|
|||
import (
|
||||
"flag"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/matrix-org/dendrite/appservice"
|
||||
"github.com/matrix-org/dendrite/clientapi"
|
||||
|
|
@ -91,7 +92,14 @@ func main() {
|
|||
// Expose the matrix APIs directly rather than putting them under a /api path.
|
||||
go func() {
|
||||
logrus.Info("Listening on ", *httpBindAddr)
|
||||
logrus.Fatal(http.ListenAndServe(*httpBindAddr, nil))
|
||||
serv := http.Server{
|
||||
Addr: *httpBindAddr,
|
||||
ReadTimeout: time.Second * 300,
|
||||
ReadHeaderTimeout: time.Second * 300,
|
||||
WriteTimeout: time.Second * 300,
|
||||
IdleTimeout: time.Second * 300,
|
||||
}
|
||||
logrus.Fatal(serv.ListenAndServe())
|
||||
}()
|
||||
// Handle HTTPS if certificate and key are provided
|
||||
go func() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue