Skip to content

Fix error seen in combinedopenended modules - #681

Merged
sarina merged 1 commit into
masterfrom
sarina/hotfix/fix-combinedopenended
Aug 14, 2013
Merged

Fix error seen in combinedopenended modules#681
sarina merged 1 commit into
masterfrom
sarina/hotfix/fix-combinedopenended

Conversation

@sarina

@sarina sarina commented Aug 14, 2013

Copy link
Copy Markdown
Contributor

Had to change graceperiod to be a Timedelta, as it is in:

common/lib/xmodule/xmodule/capa_module.py:97:    graceperiod = Timedelta(
common/lib/xmodule/xmodule/peer_grading_module.py:51:    graceperiod = Timedelta(
lms/xmodule_namespace.py:40:    graceperiod = Timedelta(

Also, change Timedeltas to be immutable field types. This will alleviate a lot of the errors we see because the Timedelta class doesn't do json roundtrips correctly, and only mutable types are marked as dirty when we access them (immutable types are only marked as dirty on a set). Plus, Timedeltas ARE immutable, so this is safe. See http://docs.python.org/2/library/datetime.html#available-types

@cpennington

Not sure who else to tag

@cpennington

Copy link
Copy Markdown
Contributor

👍

@dmitchell

Copy link
Copy Markdown
Contributor

Need unit tests, but if you promise to write those, 👍 (preferably a test which breaks w/o this fix but works w/ it)

@sarina

sarina commented Aug 14, 2013

Copy link
Copy Markdown
Contributor Author

@dmitchell I will need someone else's help to write those unit tests. If you can point me at unit tests Sef wrote when he made this change in other files, I'm happy to use those as a model.

sarina added a commit that referenced this pull request Aug 14, 2013
Fix error seen in combinedopenended modules
@sarina
sarina merged commit 6a1e88c into master Aug 14, 2013
@sarina
sarina deleted the sarina/hotfix/fix-combinedopenended branch August 14, 2013 20:53
@jzoldak
jzoldak restored the sarina/hotfix/fix-combinedopenended branch August 14, 2013 21:04
chrisrossi pushed a commit to jazkarta/edx-platform that referenced this pull request Mar 31, 2014
fixed empty space below accordion nav items that dont have a subtitle
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Mar 30, 2016
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Mar 30, 2016
e-kolpakov referenced this pull request in open-craft/openedx-platform Jun 22, 2016
Ziafazal/yonk-298: organization user removal support
johanseto pushed a commit to nelc/edx-platform that referenced this pull request Jan 22, 2024
DanielVZ96 referenced this pull request in open-craft/openedx-platform Jan 31, 2024
Abdul-Muqadim-Arbisoft referenced this pull request in edly-io/edx-platform May 8, 2024
Celery workers failed to start in development with the following stacktrace:

    cms-worker_1                 | Traceback (most recent call last):
    cms-worker_1                 |   File "/openedx/venv/bin/celery", line 8, in <module>
    cms-worker_1                 |     sys.exit(main())
    cms-worker_1                 |   File "/openedx/venv/lib/python3.8/site-packages/celery/__main__.py", line 16, in main
    cms-worker_1                 |     _main()
    cms-worker_1                 |   File "/openedx/venv/lib/python3.8/site-packages/celery/bin/celery.py", line 322, in main
    cms-worker_1                 |     cmd.execute_from_commandline(argv)
    cms-worker_1                 |   File "/openedx/venv/lib/python3.8/site-packages/celery/bin/celery.py", line 499, in execute_from_commandline
    cms-worker_1                 |     super(CeleryCommand, self).execute_from_commandline(argv)))
    cms-worker_1                 |   File "/openedx/venv/lib/python3.8/site-packages/celery/bin/base.py", line 305, in execute_from_commandline
    cms-worker_1                 |     return self.handle_argv(self.prog_name, argv[1:])
    cms-worker_1                 |   File "/openedx/venv/lib/python3.8/site-packages/celery/bin/celery.py", line 491, in handle_argv
    cms-worker_1                 |     return self.execute(command, argv)
    cms-worker_1                 |   File "/openedx/venv/lib/python3.8/site-packages/celery/bin/celery.py", line 415, in execute
    cms-worker_1                 |     return cls(
    cms-worker_1                 |   File "/openedx/venv/lib/python3.8/site-packages/celery/bin/worker.py", line 221, in run_from_argv
    cms-worker_1                 |     *self.parse_options(prog_name, argv, command))
    cms-worker_1                 |   File "/openedx/venv/lib/python3.8/site-packages/celery/bin/base.py", line 428, in parse_options
    cms-worker_1                 |     self.parser = self.create_parser(prog_name, command)
    cms-worker_1                 |   File "/openedx/venv/lib/python3.8/site-packages/celery/bin/base.py", line 440, in create_parser
    cms-worker_1                 |     description=self._format_description(self.description),
    cms-worker_1                 |   File "/openedx/venv/lib/python3.8/site-packages/celery/bin/base.py", line 462, in _format_description
    cms-worker_1                 |     text.fill_paragraphs(text.dedent(description), width))
    cms-worker_1                 |   File "/openedx/venv/lib/python3.8/site-packages/celery/utils/text.py", line 58, in fill_paragraphs
    cms-worker_1                 |     return sep.join(fill(p, width) for p in s.split(sep))
    cms-worker_1                 |   File "/openedx/venv/lib/python3.8/site-packages/celery/utils/text.py", line 58, in <genexpr>
    cms-worker_1                 |     return sep.join(fill(p, width) for p in s.split(sep))
    cms-worker_1                 |   File "/opt/pyenv/versions/3.8.12/lib/python3.8/textwrap.py", line 391, in fill
    cms-worker_1                 |     return w.fill(text)
    cms-worker_1                 |   File "/opt/pyenv/versions/3.8.12/lib/python3.8/textwrap.py", line 363, in fill
    cms-worker_1                 |     return "\n".join(self.wrap(text))
    cms-worker_1                 |   File "/opt/pyenv/versions/3.8.12/lib/python3.8/textwrap.py", line 354, in wrap
    cms-worker_1                 |     return self._wrap_chunks(chunks)
    cms-worker_1                 |   File "/opt/pyenv/versions/3.8.12/lib/python3.8/textwrap.py", line 248, in _wrap_chunks
    cms-worker_1                 |     raise ValueError("invalid width %r (must be > 0)" % self.width)
    cms-worker_1                 | ValueError: invalid width -2 (must be > 0)

This issue was reported upstream here: celery/celery#6302

It is caused by the `tty: true` statement, for some reason. It will be fixed in
Nutmeg, after celery is upgraded to 5.2.6.

Close #681.
Abdul-Muqadim-Arbisoft referenced this pull request in edly-io/edx-platform May 8, 2024
- [Fix] Crashing celery workers in development (#681). (by @regisb)
- [Fix] Fix studio logout issue. (by @Alec4r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants