Code

Opened 17 months ago

Last modified 17 months ago

#19948 new Cleanup/optimization

Improve connection reset under PostgreSQL

Reported by: aaugustin Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by aaugustin)

On django-developers, Christophe Pettus says:

It would be helpful to have a backend method that performers the "restore connection between uses" function, rather than just use connection.abort() (of course, the default implementation can use that). For example, on PostgreSQL, ABORT; DISCARD ALL is the recommended way of resetting a connection, so being able to implement that would be great.

This was independently suggested by Anssi, and it looks like a good idea to implement.

Attachments (0)

Change History (3)

comment:1 Changed 17 months ago by aaugustin

  • Description modified (diff)

comment:2 Changed 17 months ago by carljm

I think "ABORT; DISCARD ALL" may also need to be followed up with self.init_connection_state(), because it would otherwise discard the session state that Django sets up for each connection.

Last edited 17 months ago by carljm (previous) (diff)

comment:3 Changed 17 months ago by aaugustin

Yes, it should.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new
The owner will be changed from nobody to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.