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

Locked state and signals, avoid #3541

Merged
merged 2 commits into from Mar 12, 2019

Conversation

Projects
None yet
2 participants
@rjbou
Copy link
Collaborator

commented Sep 13, 2018

When opam is blocked (waiting for a lock to be released) signals abort this blocking state, like SIGWINCH wich is launched when a window is resized. This PR catch interruption caused by signals in order to ignore them.
Terminal signals still terminates the program.

rjbou added some commits Sep 10, 2018

lock: don't interrupt at non terminal signals
Signals like SIGWINCH (window resize) interrupt a blocking lock.
@AltGr

This comment has been minimized.

Copy link
Member

commented Sep 14, 2018

Note that opam normally handles SIGWINCH, and re-reads the window width to adapt line-wrapping. Ignoring it, even temporarily, will break this (non vital) feature if you resize the window while opam is waiting for the lock. Wouldn't it be possible to retry the locking after the signal was handled ? ("It wouldn't be practical" is a valid answer, signals are a mess...)

@rjbou

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 14, 2018

A solution would be to reraise the SIGWINCH once the lock released. But it isn't very precise as catched exception Unix.Unix_error (Unix.EINTR,"lockf",_) don't specify which signal is the source of the interruption, it can be SIGWINCH or SIGPIPE.

@rjbou rjbou force-pushed the rjbou:lock branch 2 times, most recently from 526b37d to 6b2eb9c Feb 6, 2019

@AltGr

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

Sorry, I misunderstood and thought you were using Sig_ignore. This is not the case, and will cause no problems with SIGWINCH :)

@AltGr AltGr merged commit 2dd020c into ocaml:master Mar 12, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@rjbou rjbou referenced this pull request Mar 27, 2019

Merged

2.0.4 backported commits #3805

@rjbou rjbou added this to the 2.0.4 milestone Mar 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.