close
Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#548 closed task (fixed)

Make sure to flush a catalog from memory in case old version is found.

Reported by: damato Owned by: tboeckel
Priority: low Milestone: YAM 2.10
Component: translation Version: 2.9p1
Severity: minor Keywords:
Cc: OS Platform: All
Blocked By: Blocking:
Release Notes:

an incompatible catalog from a former YAM version in memory can now be flushed at runtime without having to restart YAM.

Description

Phenomenon

Right after the release of YAM 2.9p1 we received numerous false positive bug reports (see #546) regarding incorrectly shipped catalog versions. However, the main fault here was that people simple forgot and even overlooked the fact that they have to reboot their systems for the catalog to be wiped from memory and reread from disks. It would therefore be a good idea to investigate if there are possibilities to flush such an old version of a catalog file from memory in case it is found.

Background analysis

As it stands we probably have the following theoretical solutions for the problem:

1) Find a way to actually flush a catalog file from memory. In principle this should be the same like flushing a library from memory which we also already partly do for old mcc versions in YAM.c
2) Enhance the warning/error message to actually try to load the catalog file from disk for checking the actual version and suggesting to reboot the machine to get the catalog flushed.
3) Enhance the Install-YAM installer script to actually force a reboot after an successful installation.

Implementation recommendation

Optimally YAM should implement option (1) for flushing a catalog from memory in case an old version is found. However, it has to be investigated if that is actually possible or if this might bring up other problems.

Attachments (2)

YAM.catalog_version_incompatible.png (3.5 KB) - added by opiopi 7 months ago.
As the WindowTiles says: YAM.catalog_version_incompatible!
RemLibs.c (388 bytes) - added by opiopi 7 months ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 7 months ago by tboeckel

The possible solution is simple, but it is not really sensitive nor does it guarantee anything. Expunging unused catalogs from memory is done by expunging locale.library. Although the latter cannot be expunged because it is used by lots of applications it will nevertheless try to expunge all unused catalogs. Thus expunging a specific catalog is not possible, only all or nothing. And there is no guarantee that the intended catalog is really removed.

But at least it is worth a try...

comment:2 Changed 7 months ago by damato

That's exactly what I mean. Of course it wouldn't be perfect but IMHO we could exactly do the same like we already have when trying to load a specific MCC version. It more or less boils down to the following sequence:

  1. Try to load the specific version
  2. If this fails, check if the reason is that a catalog with a different version is found
  3. if so, try to expunge locale.library which in turn will hopefully free the old catalog
  4. try to load the specific catalog version again
  5. if this fails again warn the user with a requester and buttons "Retry" and "Ignore".

As you said, it should be fairly easy but will definitely help these people always forgetting to reboot their systems :)

comment:3 follow-up: Changed 7 months ago by opiopi

First of all: YAM has already such function.I saw such requester some minutes ago!

You can try to expunge the locale.library but that will fail in nearly 100 percent because the library is used from the workbench too. A better method is IMHO to use the command 'avail' with the argument 'flush'. This combination also moves unused catalogs from memory to NIL:

BTW: THX for the new release. :-)

comment:4 in reply to: ↑ 3 Changed 7 months ago by damato

Replying to opiopi:

First of all: YAM has already such function.I saw such requester some minutes ago!

In fact, for the catalogs it doesn't have such a function. But when loading and finding an old MCC installed it has such a functionality, yes. That has to be, in principle, only be ported to the catalog loading routines in yam and then it should be able to expunge catalogs in memory when identifying an old catalog being installed.

You can try to expunge the locale.library but that will fail in nearly 100 percent because the library is used from the workbench too. A better method is IMHO to use the command 'avail' with the argument 'flush'. This combination also moves unused catalogs from memory to NIL:

Of course trying to expunge whole locale.library will not work but as I understand Thore it should be possible to send an expunge request to locale.library (probably via RemoveLibrary()) so that it will try to free as much memory as possible which in turn will then also expunge catalogs in memory that are currently not used.

comment:5 follow-up: Changed 7 months ago by opiopi

In fact? Then please explain me the attached picture!

Changed 7 months ago by opiopi

As the WindowTiles says: YAM.catalog_version_incompatible!

comment:6 in reply to: ↑ 5 Changed 7 months ago by damato

Replying to opiopi:

In fact? Then please explain me the attached picture!

Nothing really to explain here. This requester has been added by me a while ago to purely remind users of the fact that they have an old catalog version installed. However, at that time I added no logic or functionality to actually try to expunge a catalog in question by trying to expunge locale.library. And that's what this ticket is all about: Enhance the function that also outputs this requester to also have some kind of expunge functionality before actually showing that requester.

comment:7 follow-up: Changed 7 months ago by opiopi

Sorry then you self have done incomplete work. You can add a loop as in my attached example to flush the unused libraries which also flush unused catalogs. see attachment RemLibs.c.

Changed 7 months ago by opiopi

comment:8 in reply to: ↑ 7 Changed 7 months ago by damato

Replying to opiopi:

Sorry then you self have done incomplete work. You can add a loop as in my attached example to flush the unused libraries which also flush unused catalogs. see attachment RemLibs.c.

Thanks for the example sources, that's of course clear and obvious how this has to be done. The only change would be to only expunge locale.library and not all libraries of the system. And no, I haven't performed incomplete work but thought that by showing a message at the end of the install process that users should reboot that it should be clear what to do. But now that i already received a third mail from a user saying we supplied an old catalog version in the release archives it seems people don't read. :(

comment:9 Changed 7 months ago by tboeckel

  • Owner set to tboeckel
  • Status changed from new to assigned

comment:10 follow-up: Changed 7 months ago by tboeckel

  • Resolution set to fixed
  • Status changed from assigned to closed

In 7804:

  • Locale_c.sd: in case an incompatible catalog version is found in memory YAM will now try to expunge locale.library in order to flush any unused catalogs from memory. This closes #548.

comment:11 Changed 7 months ago by tboeckel

  • Release Notes modified (diff)

comment:12 in reply to: ↑ 10 Changed 7 months ago by damato

Replying to tboeckel:

In 7804:

  • Locale_c.sd: in case an incompatible catalog version is found in memory YAM will now try to expunge locale.library in order to flush any unused catalogs from memory. This closes #548.

Damn you were faster again ;) However, nice to see it implemented. I only have the following suggestion/wish:

Right now the requester appears right away when a catalog != the expected version is found and then the user has to press "retry". However, it would be better if it tries immediately to flush locale.library as soon as it finds an incompatible catalog, then tries to open it again and only on the second run it should put up the requester if the catalog version is still wrong. That would IMHO be a better solution.

comment:13 Changed 7 months ago by tboeckel

In 7808:

  • Locale_c.sd: reworked the catalog handling to try a silent expunge first before the user is notified. This refs #548.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Owner, Subscriber

  • Jens Maus(Reporter, Participant)
  • Thore Böckelmann(Owner, Participant)