Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mmap: changing environment #2587

Closed
markus2330 opened this issue Apr 6, 2019 · 4 comments
Closed

mmap: changing environment #2587

markus2330 opened this issue Apr 6, 2019 · 4 comments
Assignees
Labels

Comments

@markus2330
Copy link
Contributor

As follow-up to #1433, I assume that the mmap plugin is also affected. E.g. suppose $HOME changes and the new config file is also older then the mmap cache file. Then the cache file would be taken although it is actually out-of-date.

I do not expect that we can easily fix that but it would be good if you can describe the requirements we have that such problems do not occur.

@mpranj
Copy link
Member

mpranj commented Apr 6, 2019

You‘re right, currently the cache only checks the ENV in the plugins kdbOpen. It can easily be checked dynamically, but this invokes the resolver and I suspect it has quite some performance impact.

Edit: On a side note: the config is checked for the exact timestamp (nanosec granularity), but the problem still exists and is true for the default resolver too.

@markus2330
Copy link
Contributor Author

A workaround for exactly this bug would be that we also store the resolved file names within the mmap cache. But in general it would not help, we would somehow need to capture all variables that might have influence (or avoid the use of any environment variable inside of our plugins, which might be the more elegant solution anyway).

@mpranj
Copy link
Member

mpranj commented Apr 7, 2019

I did not think about this scenario, but actually we store the resolved filename within the mmap cache. If the path changes it would produce a cache miss.

Still, if $HOME changes while a KDB handle is open, it would not relocate the cache to the new home.

@markus2330
Copy link
Contributor Author

I did not think about this scenario, but actually we store the resolved filename within the mmap cache. If the path changes it would produce a cache miss.

Perfect! This is the most important case anyway. Afaik we currently do not have environment variables except for the resolvers. (Not all of the environment variables actually have an impact on the file name, though. E.g. curlresolver uses HTTP_PROXY.)

Still, if $HOME changes while a KDB handle is open, it would not relocate the cache to the new home.

Ok but this is an old bug (#1433). So I will close this bug as mmap seems to not make the situation worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants