Commit graph

3070 commits

Author SHA1 Message Date
Ankush Menat
a2b2998684
fix(DX): Wrap print format errors (#21944)
[skip ci]
2023-08-06 18:55:16 +05:30
Michelle Alva
fd2efdb0e1
chore: whitelisted typo (#21930) 2023-08-05 20:15:55 +05:30
Suraj Shetty
67a32bd054 fix: Set minimum resolution of image 2023-08-02 10:54:36 +05:30
Suraj Shetty
a7be8ccff2 Merge remote-tracking branch 'upstream' into fix-image-compression 2023-08-02 10:13:52 +05:30
Suraj Shetty
3621daf699 fix: Compress bit more agressively 2023-08-02 09:25:48 +05:30
David Arnold
3471685eaa
feat(ops): add environment variable to set bench root / workdir (#21872) 2023-07-31 11:50:09 +05:30
Ankush Menat
7ee85758b1
fix(console): dont commit when exception is raised and unconditionally check query (#21850)
* fix(console): unconditionally check query type

* fix(console): don't commit when exception occurs
2023-07-28 18:07:08 +05:30
Ankush Menat
ef51dde052
perf: set lower priority for background processes (#21841) 2023-07-28 13:01:46 +05:30
Ankush Menat
6e94cd2eb9
fix: Guess most likely exception source (#21827) 2023-07-27 17:30:04 +05:30
Abdo
35c929afdb
refactor(money in words): translatable currency Name (#21672) 2023-07-27 17:21:57 +05:30
Suraj Shetty
6c509f6dd1
Merge pull request #21782 from blaggacao/bump-bleach 2023-07-25 18:21:31 +05:30
Suraj Shetty
c0d472e95c refactor: Remove unnecessary code 2023-07-25 16:21:59 +05:30
David Arnold
a926e64ec9
fix: procure db config from single authority (#21578)
* fix: procure db config from single authority

ensures that configuration is uniformely procured from local.conf
instead of making use of hard to audit multilevel fallback logic

Implementation Note:
- `get_db(host, port, user, password)` was stripped of any optional
  argument and therefrom all errors where fixed.
- All occurances of `grep 'frappe.db.db_'` where changed to
  `frappe.conf.db_`

* fix: revert unnecessary breaking changes
2023-07-24 10:48:29 +05:30
David Arnold
8ff913b8ad
build(deps): update bleach 3.3.0 -> 6.0.0 2023-07-23 20:00:28 -05:00
Sagar Vora
9571bc1e99
Merge pull request #21770 from resilient-tech/perf-scheduler 2023-07-23 10:08:13 +00:00
Sagar Vora
5f0707c856 chore: remove unused variable 2023-07-23 15:10:37 +05:30
Sagar Vora
363a40bfb1 perf: get all Scheduled Job Types in one query 2023-07-23 15:02:50 +05:30
Ankush Menat
8436f775a5
feat(DX): PEP517 compatible build in new apps (#21704)
* chore: remove setup.py requirements.txt boilerplate

* feat(DX): PEP517 compatible builds on new apps

closes https://github.com/frappe/frappe/issues/21612
2023-07-17 12:56:41 +05:30
Ankush Menat
3f142c1dce fix: respect system setting for tracebacks
closes https://github.com/frappe/frappe/issues/19826
2023-07-16 19:18:16 +05:30
Ankush Menat
79532ea0f2 fix: incorrect cache clearing of assets
- Build version wasn't correctly computed since v14 update of build
  system. This makes client side cache useless.
- We clear cache assuming rapid reloads,but opening new tab also does
  that. This makes the cache effectively useless for most users.
2023-07-15 21:59:04 +05:30
Ankush Menat
2264c4cf47 fix: cast port to integer
closes https://github.com/frappe/frappe/issues/21687
2023-07-15 17:46:45 +05:30
David Arnold
2ccab0d625
fix: checkpoint the supported schemes for connectivity (#21576)
* fix: checkpoint the supported schemes for connectivity

This PR implements a gateway + error that clearly hints the operator at
a misconfigured system during runtime.

Particularity, against the multiple library-provided ways of configuring
redis connection strings (in python), this hard stops if an unsupported
one is chosen by accident.

* fix: remove unknown protocol

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-07-15 11:05:29 +05:30
Ankush Menat
adf30693a9 ci: update pyupgrade 2023-07-14 14:24:08 +05:30
David Arnold
6b2bb9a2ab
fix: add env overrides for service orchestration (#21577)
This avoids having to manipulate config files in brittle bash
entrypoints that need to react to dynamic service discovery.

This significantly improves the operability of various bench sites.
2023-07-14 11:39:01 +05:30
Ritwik Puri
cb156b6f24
Merge pull request #21460 from nabinhait/minor-fix-111
fix: Added option for setting default in Report filters
2023-07-06 23:52:30 +05:30
David Arnold
f5b93cc2a0
chore: urlparse already does the parsing for us, no need to diy (#21558)
This is a very minor cleanup. So minor, that it hopefully is a nobrainer
2023-07-02 21:46:53 +05:30
Gavin D'souza
883445aefa
perf: Defer pydantic imports until function call
Pydantic adds an additional 1-2MB in memory usage. We can defer it in
case an environment doesn't use it at all.
2023-07-02 16:00:50 +05:30
gavin
03fbdde007
Merge branch 'develop' into bump-pydantic-v2 2023-06-30 22:19:09 +05:30
Ankush Menat
441495b561
refactor!: Drop support for currentsite.txt (#21536)
* refactor!: Drop currentsite.txt

- `bench use` will continue to work.
- Instead of txt file use common_site_config to set default site using `default_site` key.
- `FRAPPE_SITE` environment variable also works

* fix(DX): warn if non-empty currentsite.txt is present
2023-06-30 17:57:40 +05:30
Suraj Shetty
793bcdb759
Merge branch 'develop' into minor-fix-111 2023-06-30 14:04:30 +05:30
Ankush Menat
d57c552e26 feat: frappe.enqueue with deduplication
use deduplicate=True and set job_id for automatic and mostly sane job deduplication.
2023-06-29 18:05:07 +05:30
Ankush Menat
1092eef7bd perf: faster pending jobs check 2023-06-29 17:31:06 +05:30
Ankush Menat
1668ba7d9e feat: Namespace all RQ jobs to site 2023-06-29 16:35:10 +05:30
Ankush Menat
95e49193c8
fix: dont retry if redis not available for realtime (#21517)
* fix: reduce retries for rq connection

10 seconds of retries when connection isn't available is too much, just
   failing might be beneficial.

- BusyLoadingError only occurs when redis is restarting
- ConnectionError mostly means redis is dead, no amount of retries will
  bring it back.

* fix: dont retry if redis is down for realtime
2023-06-28 15:21:04 +05:30
Ankush Menat
b9f000e1f9 refactor!: Log 5xx error to error log instead of error snapshot
Also move log_error function to right location
2023-06-28 10:59:19 +05:30
Ankush Menat
73bca16d77 feat: RQ WorkerPool
RQ now has experimental support for workerpools.

When to use this?

Roughly when you have more than 2 workers a workerpool might make
sense, below 2 it's overhead as master "pool" process will need to run
to manager workerpool itself.

Why is it any better?

Currently we just let supervisor duplicate the worker process N number
of times. This is inefficient from shared memory POV. Forking the
original process to create workers enables sharing of more memory thus
leading upwards of 60-70% reduction in memory usage with pool size of 8
workers.
2023-06-26 18:10:00 +05:30
Ankush Menat
7fbc6e8175 refactor: Simplify dequeue_strategy selection
Classes arent required anymore, it can just be a parm to worker class
isntead.
2023-06-26 17:42:18 +05:30
Ankush Menat
ca95b591ae refactor: Pass redis connection directly 2023-06-26 17:36:53 +05:30
Ankush Menat
e26152f0dc chore: use node18 for github workflow
[skip ci]
2023-06-26 13:29:18 +05:30
gavin
faab26ce4f
Merge branch 'develop' into bump-pydantic-v2 2023-06-26 13:12:24 +05:30
Ankush Menat
25c18e486c
Merge pull request #21461 from ruchamahabal/hooks
feat: before/after hooks for any app install/uninstall
2023-06-26 09:50:35 +05:30
Suraj Shetty
3982eeea22 chore: Fix linter warning 2023-06-26 09:15:20 +05:30
Ankush Menat
af03b76c88 perf: Preload and share common python modules 2023-06-24 21:24:02 +05:30
Ankush Menat
793f4ebba3 perf: defer loading JWT 2023-06-24 19:50:08 +05:30
Ankush Menat
150c36c74d fix: collect before freezing 2023-06-24 17:36:10 +05:30
Ankush Menat
29d28a460f perf: Freeze GC right before starting background worker
BG worker forks are not CoW friendly. Freezing right before we start
worker should lessen overall memory usage. Though this isn't useful much
because at max you're sharing with 2 processes - master and horse.

WorkerPool can improve this benefit a lot by forking each worker from
master process and horse from forked processes. TBD when WorkerPool is
out of beta.
2023-06-24 17:06:23 +05:30
Ankush Menat
32bd5d3e2c Revert "perf: defer many requests imports"
This reverts commit 71b44efcac.

This gets frequently imported from one place or another. Since with
gc.freeze we can mostly reuse the import from parent, let's just leave
it here.
2023-06-24 16:26:22 +05:30
Ankush Menat
6a9c9bd89d perf: defer pydoc import 2023-06-24 15:22:01 +05:30
Ankush Menat
45f8aff909 perf: defer LDAP import 2023-06-24 15:22:01 +05:30
Ankush Menat
71b44efcac perf: defer many requests imports 2023-06-24 15:22:01 +05:30