Skip to content

[FIX] odoo: rlimit cannot be set at runtime on macOS Monterey (12.0+) - #93381

Closed
pparidans wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-macos-support-app
Closed

pparidans wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-macos-support-app

Conversation

@pparidans

@pparidans pparidans commented Jun 13, 2022 •

Copy link
Copy Markdown
Contributor

When attempting to run the Odoo server on macOS Monterey (currently
12.4), it crashes with the following traceback:

Traceback (most recent call last):
  File "/Users/app/Code/odoo/odoo-bin", line 8, in <module>
    odoo.cli.main()
  File "/Users/app/Code/odoo/odoo/cli/command.py", line 61, in main
    o.run(args)
  File "/Users/app/Code/odoo/odoo/cli/server.py", line 179, in run
    main(args)
  File "/Users/app/Code/odoo/odoo/cli/server.py", line 173, in main
    rc = odoo.service.server.start(preload=preload, stop=stop)
  File "/Users/app/Code/odoo/odoo/service/server.py", line 1342, in start
    rc = server.run(preload, stop)
  File "/Users/app/Code/odoo/odoo/service/server.py", line 553, in run
    self.start(stop=stop)
  File "/Users/app/Code/odoo/odoo/service/server.py", line 491, in start
    set_limit_memory_hard()
  File "/Users/app/Code/odoo/odoo/service/server.py", line 83, in set_limit_memory_hard
    resource.setrlimit(rlimit, (config['limit_memory_hard'], hard))
ValueError: current limit exceeds maximum limit

Actually, this issue is not specific to Odoo but affects Python on macOS
as a whole (see [1] and [2]).

As our memory management is based on Linux - which is our primary
deployment target - and non-POSIX systems were already excluded, this
commit escapes the rlimit modification on non-Linux systems to prevent
this kind of issue.

References:
[1] https://bugs.python.org/issue34602
[2] python/cpython#14546

Related issue:
#79112

@robodoo

robodoo commented Jun 13, 2022 •

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@C3POdoo C3POdoo added the RD research & development, internal work label Jun 13, 2022
@pparidans
pparidans force-pushed the master-macos-support-app branch from 8c1434a to a02498f Compare June 13, 2022 09:26
@pparidans
pparidans marked this pull request as ready for review June 13, 2022 09:27
@pparidans
pparidans requested review from d-fence and xmo-odoo June 13, 2022 09:28
@C3POdoo
C3POdoo requested review from a team June 13, 2022 09:29
@pparidans
pparidans force-pushed the master-macos-support-app branch from a02498f to 781af21 Compare June 13, 2022 11:57
@Julien00859
Julien00859 removed the request for review from a team June 13, 2022 13:08
@pparidans
pparidans force-pushed the master-macos-support-app branch from 781af21 to afafcc7 Compare June 16, 2022 08:04
@pparidans pparidans changed the title [FIX] odoo,requirements: support macOS Monterey [FIX] odoo: rlimit cannot be set at runtime on macOS Monterey (12.0+) Jun 16, 2022
When attempting to run the Odoo server on macOS Monterey (currently
12.4), it crashes with the following traceback:

```
Traceback (most recent call last):
  File "/Users/app/Code/odoo/odoo-bin", line 8, in <module>
    odoo.cli.main()
  File "/Users/app/Code/odoo/odoo/cli/command.py", line 61, in main
    o.run(args)
  File "/Users/app/Code/odoo/odoo/cli/server.py", line 179, in run
    main(args)
  File "/Users/app/Code/odoo/odoo/cli/server.py", line 173, in main
    rc = odoo.service.server.start(preload=preload, stop=stop)
  File "/Users/app/Code/odoo/odoo/service/server.py", line 1342, in start
    rc = server.run(preload, stop)
  File "/Users/app/Code/odoo/odoo/service/server.py", line 553, in run
    self.start(stop=stop)
  File "/Users/app/Code/odoo/odoo/service/server.py", line 491, in start
    set_limit_memory_hard()
  File "/Users/app/Code/odoo/odoo/service/server.py", line 83, in set_limit_memory_hard
    resource.setrlimit(rlimit, (config['limit_memory_hard'], hard))
ValueError: current limit exceeds maximum limit
```

Actually, this issue is not specific to Odoo but affects Python on macOS
as a whole (see [1] and [2]).

As our memory management is based on Linux - which is our primary
deployment target - and non-POSIX systems were already excluded, this
commit escapes the rlimit modification on non-Linux systems to prevent
this kind of issue.

References:
[1] https://bugs.python.org/issue34602
[2] python/cpython#14546

Related issue:
odoo#79112
@pparidans
pparidans force-pushed the master-macos-support-app branch from afafcc7 to c49c5ef Compare June 16, 2022 08:06
@pparidans

Copy link
Copy Markdown
Contributor Author

@xmo-odoo @d-fence As discussed, I removed the commit about the requirements.txt.
Possible to get a review from you guys? 🙇

@xmo-odoo

Copy link
Copy Markdown
Collaborator

@robodoo r+

robodoo pushed a commit that referenced this pull request Jun 16, 2022
When attempting to run the Odoo server on macOS Monterey (currently
12.4), it crashes with the following traceback:

```
Traceback (most recent call last):
  File "/Users/app/Code/odoo/odoo-bin", line 8, in <module>
    odoo.cli.main()
  File "/Users/app/Code/odoo/odoo/cli/command.py", line 61, in main
    o.run(args)
  File "/Users/app/Code/odoo/odoo/cli/server.py", line 179, in run
    main(args)
  File "/Users/app/Code/odoo/odoo/cli/server.py", line 173, in main
    rc = odoo.service.server.start(preload=preload, stop=stop)
  File "/Users/app/Code/odoo/odoo/service/server.py", line 1342, in start
    rc = server.run(preload, stop)
  File "/Users/app/Code/odoo/odoo/service/server.py", line 553, in run
    self.start(stop=stop)
  File "/Users/app/Code/odoo/odoo/service/server.py", line 491, in start
    set_limit_memory_hard()
  File "/Users/app/Code/odoo/odoo/service/server.py", line 83, in set_limit_memory_hard
    resource.setrlimit(rlimit, (config['limit_memory_hard'], hard))
ValueError: current limit exceeds maximum limit
```

Actually, this issue is not specific to Odoo but affects Python on macOS
as a whole (see [1] and [2]).

As our memory management is based on Linux - which is our primary
deployment target - and non-POSIX systems were already excluded, this
commit escapes the rlimit modification on non-Linux systems to prevent
this kind of issue.

References:
[1] https://bugs.python.org/issue34602
[2] python/cpython#14546

Related issue:
#79112

closes #93381

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
@robodoo robodoo closed this Jun 16, 2022
@robodoo
robodoo temporarily deployed to merge June 16, 2022 16:31 Inactive
@robodoo robodoo added the 15.5 label Jun 16, 2022
@pparidans
pparidans deleted the master-macos-support-app branch June 20, 2022 07:54
@xmo-odoo xmo-odoo added 16.0 and removed 15.5 labels Nov 27, 2025

This branch was previously deployed

1 inactive deployment
merge — c49c5eff Deployed Jun 16, 2022 by robodoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

16.0 RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants