Commit Graph
86 Commits
Author SHA1 Message Date
Guewen BaconnierandSimone Orsi cca0ba6bd8 [9.0] Filter /monitoring/status werkzeug logs (#68)
* Filter /monitoring/status werkzeug logs

With healtchecks, they constitute 95% of our logs. Let's stop wasting
resources and shut them up.
2019-07-19 15:34:23 +02:00
Timon TschanzandGitHub 8332929cb4 Merge pull request #64 from tschanzt/fix_inverse_datas
Fix inverse datas for swift storage
2019-06-18 17:09:13 +02:00
Timon Tschanz f5fdc3a7cf Fix inverse datas for swift storage 2019-05-31 18:03:47 +02:00
Guewen BaconnierandGitHub 92ca087101 Merge pull request #55 from guewen/swift-auth-session
attachment_swift: share a session for all connections
2019-05-07 15:29:16 +02:00
Guewen Baconnier 3e20f1563f Pin PyYAML version because 5.x does not work with Odoo
It would raise ConstructorError: could not determine a constructor for the tag '!record'
2019-05-02 16:45:59 +02:00
Guewen Baconnier 4e919d85cb attachment_swift: share a session for all connections
OVH's Swift applies a rate limit on the authentication.

attachment_swift authenticates again each time it has to read/write an
attachment. When running upgrades on upgrades of files or installing a
new DB, at some point, we get rejected with HTTP 429.

This commit introduces a shared storage for Swift Session. All
connections will reuses the same authentication token created the first
time a connection needs a Session.

Note: needs python-swiftclient>=3.7.0 to have
https://github.com/openstack/python-swiftclient/commit/1971ef880ff225379d4a91f00f89f323a1605eeb
2019-05-02 16:13:04 +02:00
Guewen Baconnier 85d32e44c6 Add missing variable in documentation example 2019-05-02 15:29:16 +02:00
Guewen Baconnier 6d27097ca9 Add setuptools files 2018-12-03 10:04:53 +01:00
Guewen Baconnier 5d9a51ef8c Edit readme 2018-12-03 10:04:33 +01:00
jcouxandGitHub 6f21400653 Merge pull request #40 from camptocamp/add_ovh_in_v9
[9.0] Backport OVH modules from 10.0
2018-10-30 12:04:39 +01:00
jcoux a3c61c6c6c Backport fix on session check crash (PR 33) 2018-10-30 08:54:01 +01:00
jcoux 7fc296d73e Backport OVH modules from 10.0 2018-10-29 13:45:20 +01:00
jcoux c6a0e7c1f5 Get OVH modules from 10.0 2018-10-29 11:10:49 +01:00
Guewen BaconnierandGitHub 8bd5049b7d Merge pull request #36 from guewen/9.0-force-storage-at-upgrades
9.0 Fix attachments stored in FS instead of object storage
2018-06-14 09:34:30 +02:00
Guewen Baconnier d1bb60fc11 attachment_s3: bump 1.3.0 2018-06-13 17:26:08 +02:00
Guewen Baconnier c3d9aceb0f Document a weird domain which is there for a reason
The reason being:
https://github.com/odoo/odoo/blob/9032617120138848c63b3cfa5d1913c5e5ad76db/odoo/addons/base/ir/ir_attachment.py#L344-L347

I nearly deleted this domain but it was too weird to be there for no
reason. A comment explaining the issue was really missing.
2018-06-13 17:16:07 +02:00
Guewen Baconnier ddb7656abd Fix attachments stored in FS instead of object storage
Assume the following situation:

* We have installed addons base, sale and attachment_s3 (hence
base_attachment_object_storage as dependency)
* All attachments are in S3 already
* We run an upgrade of the 'base' addon, 'sale' is upgraded before
attachment_s3 in the order of loading.
* Sale updates the icon of the Sale menu
* As attachment_s3 is not loaded yet, the attachment is created in the
filestore

Now if we don't persist the filestore or use different servers, we'll
lose the images of the menus (or any attachment loaded by the
install/upgrade of an addon).

The implemented solution is to move the attachments from the filestore
to the object storage at the loading of the module. However, this
operation can take time and it shouldn't be run by 2 processes at the
same time, so we want to detect if the module is loaded during a normal odoo
startup or when some addons have been upgraded. There is nothing anymore
at this point which allow us to know that modules just have been
upgraded except... in the caller frame (load_modules). We have to rely
on the inpect module and get the caller frame, which is not recommended,
but seems the only way, besides, it's not called often and if
_register_hook was called from another place, it would have no effect
(unless the other place has a variable 'update_module' too).
2018-06-13 17:15:45 +02:00
Guewen Baconnier f915b8a1be Ensure that migration of files is commited before deleting files
When moving attachments from the filestore to an object storage, the
filesystem files will be deleted only after the commit, so if the
transaction is rollbacked, we still have the local files for another
try.
2018-06-13 17:15:18 +02:00
jcouxandGitHub 06e6f96326 Merge pull request #25 from guewen/monitoring-short-living-sessions
Expire sessions generated by health checks quickly
2018-01-11 08:20:39 +01:00
Guewen Baconnier a0c926a478 Expire sessions generated by health checks quickly
The default expiration of sessions is 7 days. With healthchecks run
every few seconds, we quickly have millions of anonymous sessions in
Redis. Allow to define a custom expiration for some sessions and set a
very short one for the monitoring requests.
2018-01-04 09:27:50 +01:00
Guewen BaconnierandGitHub 7f5f6d0f92 Merge pull request #14 from guewen/9.0-better-s3-access-error-msg
[9.0] Make error message more precise for S3 access
2017-08-29 11:37:15 +02:00
Guewen Baconnier 64b79cc848 Make error message more precise for S3 access
The previous error message let think that you should set AWS_BUCKETNAME,
although you should set it only if you are trying to write in this
repository.
2017-08-28 14:40:31 +02:00
Guewen BaconnierandGitHub 418e0cc3ff Merge pull request #10 from guewen/9.0-session-redis-sentinel
[9.0] Allow to use a Redis Sentinel
2017-05-18 16:40:14 +02:00
Guewen Baconnier bcb4b8b98d Allow to use a Redis Sentinel 2017-05-16 09:07:30 +02:00
Guewen Baconnier 4823d10eb5 Do not force metrics on production 2017-04-29 09:19:16 +02:00
Guewen Baconnier 5d6fc2722c Fix calls on multi instead of record 2017-04-26 15:58:39 +02:00
Vincent RenavilleandGitHub fa008a3e83 Merge pull request #9 from vrenaville/delivery_carrier_label_s3
[FIX] call method on attachement_id instead of self
2017-02-15 19:01:37 +01:00
vrenaville b57ee6bf95 [FIX] call method on attachement_id instead of self 2017-02-15 18:57:20 +01:00
vrenaville a8501bf67c [FIX] call method on attachement_id instead of self 2017-02-15 18:50:32 +01:00
Vincent RenavilleandGitHub 14ad7fb30a Merge pull request #8 from vrenaville/delivery_carrier_label_s3
Delivery carrier label s3
2017-02-15 15:46:38 +01:00
vrenaville c4b5ba142d [ADD] OCA dependencies 2017-02-15 13:58:44 +01:00
vrenaville 3a29134fc4 [FIX] adapt license 2017-02-15 13:39:58 +01:00
vrenaville 68d9d8de19 [ADD] delivery_carrier_label_s3 module 2017-02-15 13:23:42 +01:00
Guewen BaconnierandGitHub 188643b7d3 Merge pull request #7 from guewen/fix-slow-partner-kanban-view
Fix Contacts view too slow to display
2017-02-09 13:13:53 +01:00
Guewen Baconnier 4d8400d0bf Fix Contacts view too slow to display
The 'base' Kanban view for res.partner in 9.0 loads the large 'image'
field in the 'search_read' but display the 'small_image'. The js code
also has to issue js calls to get the small images as they have not been
prefetched. This is noticeably slow to load when the large images are
read from S3 which is slower than a local filesystem/database.

This fix loads the 'small_image' instead of the large one.

This bug has been fixed in Odoo 10.0.
2017-02-09 11:49:23 +01:00
Guewen Baconnier 8ad99c9336 Add more details in asserts 2017-01-17 11:07:36 +01:00
Guewen BaconnierandGitHub 4cd8c214ec Merge pull request #6 from guewen/9.0-attachment-fast-web-access
Store files that need fast access in the database
2017-01-16 17:27:31 +01:00
Guewen Baconnier 624cc0b743 Store files that need fast access in the database
An Object Storage read is slower than a disk of database access.
It might take ~200 to 300ms to retrieve a file content.

This is not an issue for attachments such as the pdf files or any
attachment that we want to read on demand. But that's too slow for
files needed to render a web page.

We'll store in the database:

* Assets (js, css, ...). As a side effect, the databases will be more
  portable, as assets are rebuilt frequently, storing them in the Object
  Storage led the integration server to try to read assets deleted since
  long ago
* Attachments linked to Binary fields named 'image_small',
  'image_medium', 'web_icon_data'. Those fields are often used on kanban
  views that display a lot a images and retrieving them all was then
  very slow (Odoo does not do async requests).

The migration to S3 is no longer called during initialization of the
registry: it would be too slow as we would have to define if the
attachments must be kept in database or sent to S3 on each new start. It
means we have to call `env['ir.attachment'].force_storage()` to run the
migration.
2017-01-16 17:12:52 +01:00
Guewen Baconnier 022f9003e8 Add debug logs in session_redis 2016-12-14 11:25:12 +01:00
Guewen Baconnier 997f92aaab Rename builtin id variable 2016-12-13 12:21:37 +01:00
Guewen Baconnier d138a1fd3d Be more defensive against concurrent workers
When migrating attachments to S3, several workers may try to migrate
the same attachments. Do not fail when both update the same attachment.
2016-12-13 12:01:50 +01:00
Guewen Baconnier 5f61ed8985 registry is useless in the second branch 2016-12-13 09:06:50 +01:00
Guewen Baconnier 53d7cdf3e7 Fix attachment_s3: do not open a new cursor
Because it provokes serialization errors during the installation or
update of addons. Do not commit as we might commit unwanted things...
Later, we might want to add a specific, more elaborate, migration
process.
2016-12-13 08:58:08 +01:00
Guewen BaconnierandGitHub 8b15070c7f Merge pull request #4 from guewen/add-load-readme
Document --load option for some addons
2016-11-14 08:29:51 +01:00
Guewen Baconnier 607268bd4f Delete S3 file only when bucket is the current one 2016-11-14 08:29:13 +01:00
Guewen Baconnier 779aa03c57 Explicit attachment_s3 must be started in --load 2016-11-10 16:14:19 +01:00
Guewen Baconnier 92880deeab Explicit session_redis must be started in --load 2016-11-10 16:14:19 +01:00
Guewen Baconnier 78ac4d306e Document --load option 2016-11-10 16:14:19 +01:00
Guewen Baconnier 110ec2399d Add logging when deleting file on the object storage 2016-11-07 10:11:23 +01:00
Guewen Baconnier 7f262799cf Do not care if an attachment could not be deleted 2016-11-07 09:50:26 +01:00