-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Fixed #33817 -- Added support for python-oracledb and deprecated cx_Oracle. #15841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hello @petronny! Thank you for your contribution 💪 As it's your first contribution be sure to check out the patch review checklist. If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket! If you have any design or process questions then you can ask in the Django forum. Welcome aboard ⛵️! |
8e4f1fb
to
528b938
Compare
@petronny We should change |
76b898b
to
970e291
Compare
072a48d
to
729dcbf
Compare
buildbot, test on oracle. |
@petronny Please push fixes in separate commits. It's hard to review after force-push. |
OK. The last change only replaces This won't fix the failed test in oragis. I've created an issue oracle/python-oracledb#43 for it on oracledb. |
Line 274 in 5aa4c0b
On Jenkins
on my local machine:
|
So it looks like Python 3.11 changed stuff with the frame object: https://docs.python.org/3/whatsnew/3.11.html#pyframeobject-3-11-hiding It also looks like |
Yes, |
Python code as Django uses it shall never segfault. If it does it is bug in Python or from the looks of it in this case cython / python-oracledb.
…On Tue, Aug 8, 2023, at 19:06, Anthony Tuininga wrote:
Yes, `python-oracledb` is using `cython`. So does this mean something
needs to change in Django to handle the changes to the frames? Is this
specific to Python 3.11 then?
—
Reply to this email directly, view it on GitHub
<#15841 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAT5C5VCPS6QP5DG6LTUWLXUJW25ANCNFSM53J2OIHA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I tried running the test suite on my machine using a local database (running 21.3) and it raised a number of exceptions but didn't segfault. I don't know precisely how you are running the test suite and what you have in your settings file. If you are able to share that information I can try replicate the issue here. Currently I see the following results:
This is the contents of my settings file: # This is an Oracle test settings file for use with the Django test suite.
#
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.oracle',
'NAME': 'localhost/DB21PDB1',
'USER': 'django',
'PASSWORD': 'dev',
'TEST': {
'USER': 'default_django_test',
'TBLSPACE': 'default_django_test_ts',
'TBLSPACE_TMP': 'default_django_temp_ts'
}
},
'other': {
'ENGINE': 'django.db.backends.oracle',
'NAME': 'localhost/DB21PDB1',
'USER': 'django',
'PASSWORD': 'dev',
'TEST': {
'USER': 'other_django_test',
'TBLSPACE': 'other_django_test_ts',
'TBLSPACE_TMP': 'other_django_temp_ts'
}
},
}
DEFAULT_AUTO_FIELD='django.db.models.BigAutoField'
USE_TZ=False
SECRET_KEY="my_secret" If any of this is incorrect (for example, a lot of failures are about the "wrong" AutoField) then please advise. I'd like to get to the bottom of this issue if at all possible! |
Ok. I tweaked the settings file to follow the suggested file from @petronny. I now get this:
Running the test that causes the segfault runs just fine on my machine. This is on Linux x86_64, Python 3.11.4 with the python-oracledb 1.3.2 prebuilt binary that was released publicly. Adding print statements in the |
You can see the CI job here: The configuration of interest would be And looking at the latest build, specifically the full console output, we can see that it uses:
It may be that this has been fixed in 3.11.2 - see release notes. This sounds suspiciously relevant:
If you can install Python 3.11.1 and reproduce and then see if 3.11.2 fixes the issue it'd be helpful to confirm. |
I could download and install 3.11.1 but is there a reason why the CI job doesn't get upgraded to 3.11.4? I am unable to replicate with 3.11.4 and your releaase notes reference does indeed seem quite relevant. Cython is likely using PyFrame_New() to build its frames. |
I bumped Python versions on CI nodes, we will see. |
All tests have passed with python 3.11.4. 🎉
|
No, we only officially supports the latest version.
TBH, we don't have the time and resources to extensively test for Oracle drivers. |
Then do we need to note that we only support the thin mode? |
It should work fine in Thick mode (as it has been doing so for many years), so I don't think the word 'support' is useful to add. You could say it was tested with Thin mode if you want to say anything. If any Thick mode issues are logged we can address them. |
tests/requirements/oracle.txt
Outdated
@@ -1 +1 @@ | |||
cx_oracle >= 7.0 | |||
oracledb >= 1.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to set oracledb >= 1.3.3
as the minimum supported version. @anthony-tuininga When we can expect the next bugfix release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current release is 1.3.2. Version 1.4 will come out in a few weeks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can wait a bit, the feature freeze for Django 5.0 is on September, 18th.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would set 1.3.2 as minimum supported. This will give maximum testing time before Django 5.0. The changes in 1.4 are around areas that won't impact Django users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in 1.4 are around areas that won't impact Django users.
Some bugfixes are related, e.g. oracle/python-oracledb#211.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Un)fortunately, I'm on vacation next week. We can try after August, 21st or you can contact directly with the DSF board. I'm sure they would love to chat (\cc @django/dsf-board).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixxm next week is busy for me too, so I can wait until you return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixxm next week is busy for me too, so I can wait until you return.
I'm available for a call if you still want to catch up (daily from 6 am UTC to 12 o'clock UTC). We can figure out another time-slot if it doesn't work for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixxm I've sent a calendar invitation to meet tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sarahboyce I only used this conversion as a reference for the version bump.
Rebased. |
@petronny Thanks 👍 Welcome aboard ⛵ I pushed small edits. |
Yay! A big thanks to all. |
Superb. Let us (@oracle) know if there are features that require attention. |
cx_Oracle has a major new release under a new name and homepage python-oracledb.
The python-oracledb driver is a Python programming language extension module allowing Python programs to connect to Oracle Database. Python-oracledb is the new name for Oracle's popular cx_Oracle driver.
Tested on an Oracle Autonomous Database with TLSv1 connection.
Ticket: https://code.djangoproject.com/ticket/33817