Skip to content

Conversation

@bdc34
Copy link
Contributor

@bdc34 bdc34 commented Apr 24, 2022

This adds a session UUID to the repl history.

#44681

REPLHistoryProvider(mode_mapping::Dict{Symbol}) =
REPLHistoryProvider(String[], nothing, 0, 0, -1, IOBuffer(),
nothing, mode_mapping, UInt8[])
nothing, mode_mapping, UInt8[], UUID(rand(UInt128)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe could use uuid4() instead of UUID(rand(UInt128))?

@StefanKarpinski
Copy link
Member

I'm not entirely sure about this. I think I'd prefer to have an option to shard the history file by process, which would also help with situations where the ~/.julia directory is on a shared file system. In other words, instead of saving a UUID with each entry, have separate history files based on host name and PID.

@bdc34 bdc34 changed the title Adds session id to REPL history (#44681) WIP Adds session id to REPL history (#44681) Apr 27, 2022
@jariji
Copy link
Contributor

jariji commented Aug 5, 2023

PIDs aren't guaranteed to be unique even within an OS boot, nor across boots.

Process IDs, in the first place, are usually allocated on a sequential basis, beginning at 0 and rising to a maximum value which varies from system to system. Once this limit is reached, allocation restarts at 300 and again increases. In macOS and HP-UX, allocation restarts at 100.

https://en.wikipedia.org/wiki/Process_identifier

Why is uuid not suitable for shared filesystems?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants