mirror of
				https://github.com/matrix-org/synapse.git
				synced 2025-11-04 02:01:03 +01:00 
			
		
		
		
	Merge branch 'develop' into release-v0.34.1
This commit is contained in:
		
						commit
						484867d35d
					
				
							
								
								
									
										1
									
								
								changelog.d/4361.misc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								changelog.d/4361.misc
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					Add better logging for unexpected errors while sending transactions
 | 
				
			||||||
							
								
								
									
										1
									
								
								changelog.d/4362.misc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								changelog.d/4362.misc
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					Add better logging for unexpected errors while sending transactions
 | 
				
			||||||
@ -522,8 +522,13 @@ class TransactionQueue(object):
 | 
				
			|||||||
            )
 | 
					            )
 | 
				
			||||||
        except FederationDeniedError as e:
 | 
					        except FederationDeniedError as e:
 | 
				
			||||||
            logger.info(e)
 | 
					            logger.info(e)
 | 
				
			||||||
 | 
					        except HttpResponseException as e:
 | 
				
			||||||
 | 
					            logger.warning(
 | 
				
			||||||
 | 
					                "TX [%s] Received %d response to transaction: %s",
 | 
				
			||||||
 | 
					                destination, e.code, e,
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
        except RequestSendFailed as e:
 | 
					        except RequestSendFailed as e:
 | 
				
			||||||
            logger.warning("(TX [%s] Failed to send transaction: %s", destination, e)
 | 
					            logger.warning("TX [%s] Failed to send transaction: %s", destination, e)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            for p, _ in pending_pdus:
 | 
					            for p, _ in pending_pdus:
 | 
				
			||||||
                logger.info("Failed to send event %s to %s", p.event_id,
 | 
					                logger.info("Failed to send event %s to %s", p.event_id,
 | 
				
			||||||
 | 
				
			|||||||
@ -823,21 +823,21 @@ def check_content_type_is_json(headers):
 | 
				
			|||||||
        headers (twisted.web.http_headers.Headers): headers to check
 | 
					        headers (twisted.web.http_headers.Headers): headers to check
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Raises:
 | 
					    Raises:
 | 
				
			||||||
        RuntimeError if the
 | 
					        RequestSendFailed: if the Content-Type header is missing or isn't JSON
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    c_type = headers.getRawHeaders(b"Content-Type")
 | 
					    c_type = headers.getRawHeaders(b"Content-Type")
 | 
				
			||||||
    if c_type is None:
 | 
					    if c_type is None:
 | 
				
			||||||
        raise RuntimeError(
 | 
					        raise RequestSendFailed(RuntimeError(
 | 
				
			||||||
            "No Content-Type header"
 | 
					            "No Content-Type header"
 | 
				
			||||||
        )
 | 
					        ), can_retry=False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    c_type = c_type[0].decode('ascii')  # only the first header
 | 
					    c_type = c_type[0].decode('ascii')  # only the first header
 | 
				
			||||||
    val, options = cgi.parse_header(c_type)
 | 
					    val, options = cgi.parse_header(c_type)
 | 
				
			||||||
    if val != "application/json":
 | 
					    if val != "application/json":
 | 
				
			||||||
        raise RuntimeError(
 | 
					        raise RequestSendFailed(RuntimeError(
 | 
				
			||||||
            "Content-Type not application/json: was '%s'" % c_type
 | 
					            "Content-Type not application/json: was '%s'" % c_type
 | 
				
			||||||
        )
 | 
					        ), can_retry=False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def encode_query_args(args):
 | 
					def encode_query_args(args):
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user