"state_info" is not always trimmed properly
Bug #1698125 reported by
Renat Akhmerov
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mistral |
Fix Released
|
High
|
Renat Akhmerov |
Bug Description
When Mistral engine stores an execution object it trims field "state_info" to make sure it fits into 65535 bytes (maximum size of MySQL TEXT type). However, if the initial value that is going into "state_info" is a dictionary (e.g. an action returned it as a result) then the method utils.cut() can return a dict whose string representation will slightly go beyond the expected limit. In this case we'll get a DB error. This is related to how method utils.cut_dict() works internally. In other words, it doesn't provide a guarantee that it will be exactly of the expected length.
Changed in mistral: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Renat Akhmerov (rakhmerov) |
milestone: | none → pike-3 |
Changed in mistral: | |
status: | Confirmed → In Progress |
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/474195 /git.openstack. org/cgit/ openstack/ mistral/ commit/ ?id=5a43d54a058 ea4e13924c596b0 bee93b727a1f95
Committed: https:/
Submitter: Jenkins
Branch: master
commit 5a43d54a058ea4e 13924c596b0bee9 3b727a1f95
Author: Renat Akhmerov <email address hidden>
Date: Wed Jun 14 20:10:03 2017 +0700
Make sure that the field "state_info" trimmed as expected
* Before this patch, "state_info" field of execution objects
DBDataError: (_mysql_ exceptions. DataError) (1406, "Data too ation is always less than 65536 bytes (i.e. the size
wasn't truncated properly before saving into DB which led to
the DB error like:
long for column 'state_info' at row 1")
It was happening because the method utils.cut() didn't work
accurately enough in case if we passed it with a dictionary.
This patch doesn't fix utils.cut() method but it just saves
space for possible method result difference with the expected
length so that we make sure that the truncated string
represent
of MySQL TEXT type). The total difference is not critical
anyway.
Closes-Bug: #1698125 6224aaea564588c 53a3e2c6adc
Change-Id: I18449710ace627