Skip to content

Commit 533f36f

Browse files
Merge pull request #986 from deisseroth-lab/jobs-error-stack-medium-blob
Changes ~jobs.error_stack from blob to mediumblob
2 parents f0eb26a + 3e3f08e commit 533f36f

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Bugfix - Fix sql code generation to comply with sql mode `ONLY_FULL_GROUP_BY` (#916) PR #965
1616
* Bugfix - Fix count for left-joined `QueryExpressions` (#951) PR #966
1717
* Bugfix - Fix assertion error when performing a union into a join (#930) PR #967
18+
* Update `~jobs.error_stack` from blob to mediumblob to allow error stacks >64kB in jobs (#984) PR #986
1819

1920
### 0.13.2 -- May 7, 2021
2021
* Update `setuptools_certificate` dependency to new name `otumat`
@@ -248,7 +249,7 @@ Documentation and tutorials available at https://docs.datajoint.io and https://t
248249
* ERD() no longer text the context argument.
249250
* ERD.draw() now takes an optional context argument. By default uses the caller's locals.
250251

251-
### 0.3.2.
252+
### 0.3.2.
252253
* Fixed issue #223: `insert` can insert relations without fetching.
253254
* ERD() now takes the `context` argument, which specifies in which context to look for classes. The default is taken from the argument (schema or relation).
254255
* ERD.draw() no longer has the `prefix` argument: class names are shown as found in the context.

datajoint/jobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(self, conn, database):
3232
status :enum('reserved','error','ignore') # if tuple is missing, the job is available
3333
key=null :blob # structure containing the key
3434
error_message="" :varchar({error_message_length}) # error message returned if failed
35-
error_stack=null :blob # error stack if failed
35+
error_stack=null :mediumblob # error stack if failed
3636
user="" :varchar(255) # database user
3737
host="" :varchar(255) # system hostname
3838
pid=0 :int unsigned # system process id

docs-parts/intro/Releases_lang1.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* Bugfix - Fix count for left-joined ``QueryExpressions`` (#951) PR #966
1515
* Bugfix - Fix assertion error when performing a union into a join (#930) PR #967
1616
* Bugfix - Fix regression issue with `DISTINCT` clause and `GROUP_BY` (#914) PR #963
17+
* Update `~jobs.error_stack` from blob to mediumblob to allow error stacks >64kB in jobs (#984) PR #986
1718

1819
0.13.2 -- May 7, 2021
1920
----------------------

tests/test_jobs.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,23 @@ def test_long_error_message():
122122
assert_true(error_message == short_error_message, 'error messages do not agree')
123123
assert_false(error_message.endswith(TRUNCATION_APPENDIX), 'error message should not be truncated')
124124
schema.schema.jobs.delete()
125+
126+
127+
def test_long_error_stack():
128+
# clear out jobs table
129+
schema.schema.jobs.delete()
130+
131+
# create long error stack
132+
STACK_SIZE = 89942 # Does not fit into small blob (should be 64k, but found to be higher)
133+
long_error_stack = ''.join(random.choice(string.ascii_letters) for _ in range(STACK_SIZE))
134+
assert subjects
135+
table_name = 'fake_table'
136+
137+
key = subjects.fetch('KEY')[0]
138+
139+
# test long error stack
140+
schema.schema.jobs.reserve(table_name, key)
141+
schema.schema.jobs.error(table_name, key, 'error message', long_error_stack)
142+
error_stack = schema.schema.jobs.fetch1('error_stack')
143+
assert error_stack == long_error_stack, 'error stacks do not agree'
144+
schema.schema.jobs.delete()

0 commit comments

Comments
 (0)