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

Two requests to one file are not done in parallel #42121

Closed
mmf1987 mannequin opened this issue Jun 25, 2005 · 11 comments
Closed

Two requests to one file are not done in parallel #42121

mmf1987 mannequin opened this issue Jun 25, 2005 · 11 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@mmf1987
Copy link
Mannequin

mmf1987 mannequin commented Jun 25, 2005

BPO 1227480
Nosy @birkenfeld, @josiahcarlson
Files
  • test1.py: test1.py - the little CGI script written in Python
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2005-06-30.08:49:54.000>
    created_at = <Date 2005-06-25.19:24:48.000>
    labels = ['interpreter-core']
    title = 'Two requests to one file are not done in parallel'
    updated_at = <Date 2005-06-30.08:49:54.000>
    user = 'https://bugs.python.org/mmf1987'

    bugs.python.org fields:

    activity = <Date 2005-06-30.08:49:54.000>
    actor = 'jafo'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2005-06-25.19:24:48.000>
    creator = 'mmf1987'
    dependencies = []
    files = ['1728']
    hgrepos = []
    issue_num = 1227480
    keywords = []
    message_count = 11.0
    messages = ['25632', '25633', '25634', '25635', '25636', '25637', '25638', '25639', '25640', '25641', '25642']
    nosy_count = 4.0
    nosy_names = ['georg.brandl', 'jafo', 'josiahcarlson', 'mmf1987']
    pr_nums = []
    priority = 'normal'
    resolution = 'works for me'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1227480'
    versions = []

    @mmf1987
    Copy link
    Mannequin Author

    mmf1987 mannequin commented Jun 25, 2005

    Hi!

    I am using Python for CGI scripting. I had a little cgi
    script (see the attached file).

    I saved it as test1.py - and tried to load it over HTTP. So
    everything is fine.

    But now I saw a very strange behaviour: I sent two
    parallel requests to
    the script (for example by sending two requests in two
    browser windows
    almost at the same time).

    My problem: The requests to the script seem NOT to be
    done in parallel:
    The first script prints "starting..." and after a short time
    "finished". And then in the other browser window the
    second request
    shows "starting...".

    But I expected that in both browser windows "starting"
    will be shown
    almost at the same time because the two requests are
    done in parallel.

    The strange behaviour goes on:
    If copied the test1.py and saved it as test2.py. Now I
    retried my test
    and sent two requests - but to these two identical files
    (that only
    differ in their filename). The the two requests seem to be
    done in
    parallel...

    (It tried my test on Fedora and Gentoo Linux, with
    Python 2.2 and
    Python 2.4, with different webservers (Apache and
    others), and with
    several different browsers - I always was the same.)

    I think the behaviour will be the same if I use my script
    on the command line...

    Best regards,
    Markus Franz

    @mmf1987 mmf1987 mannequin closed this as completed Jun 25, 2005
    @mmf1987 mmf1987 mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jun 25, 2005
    @mmf1987 mmf1987 mannequin closed this as completed Jun 25, 2005
    @mmf1987 mmf1987 mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jun 25, 2005
    @jafo
    Copy link
    Mannequin

    jafo mannequin commented Jun 29, 2005

    Logged In: YES
    user_id=81797

    There's no uploaded file! You have to check the
    checkbox labeled "Check to Upload & Attach File"
    when you upload a file.

    Please try again.

    (This is a SourceForge annoyance that we can do
    nothing about. :-( )

    4 similar comments
    @jafo
    Copy link
    Mannequin

    jafo mannequin commented Jun 29, 2005

    Logged In: YES
    user_id=81797

    There's no uploaded file! You have to check the
    checkbox labeled "Check to Upload & Attach File"
    when you upload a file.

    Please try again.

    (This is a SourceForge annoyance that we can do
    nothing about. :-( )

    @jafo
    Copy link
    Mannequin

    jafo mannequin commented Jun 29, 2005

    Logged In: YES
    user_id=81797

    There's no uploaded file! You have to check the
    checkbox labeled "Check to Upload & Attach File"
    when you upload a file.

    Please try again.

    (This is a SourceForge annoyance that we can do
    nothing about. :-( )

    @jafo
    Copy link
    Mannequin

    jafo mannequin commented Jun 29, 2005

    Logged In: YES
    user_id=81797

    There's no uploaded file! You have to check the
    checkbox labeled "Check to Upload & Attach File"
    when you upload a file.

    Please try again.

    (This is a SourceForge annoyance that we can do
    nothing about. :-( )

    @jafo
    Copy link
    Mannequin

    jafo mannequin commented Jun 29, 2005

    Logged In: YES
    user_id=81797

    There's no uploaded file! You have to check the
    checkbox labeled "Check to Upload & Attach File"
    when you upload a file.

    Please try again.

    (This is a SourceForge annoyance that we can do
    nothing about. :-( )

    @josiahcarlson
    Copy link
    Mannequin

    josiahcarlson mannequin commented Jun 30, 2005

    Logged In: YES
    user_id=341410

    I doubt that this is a Python issue. It seems more likely
    that your web servers are only willing to spawn a single CGI
    process at any one time.

    @jafo
    Copy link
    Mannequin

    jafo mannequin commented Jun 30, 2005

    Logged In: YES
    user_id=81797

    I would tend to agree that it's unlikely to be a Python
    issue, but I'd be willing to try to reproduce it given
    further information.

    @josiahcarlson
    Copy link
    Mannequin

    josiahcarlson mannequin commented Jun 30, 2005

    Logged In: YES
    user_id=341410

    It's not a Python issue. I can run multiple copies of
    Python in the same console. It's the
    non-forking/non-threaded web server the OP is using.

    bash-2.05b$ /cygdrive/c/python24/python -c \

    "import time;time.sleep(1);import
    sys;sys.stdout.write('hello\r\n');\
    sys.stdout.flush();[i for i in xrange(10000000)];\
    ss.stdout.write('goodbye\r\n');sys.stdout.flush()" &
    [1] 2380
    bash-2.05b$ /cygdrive/c/python24/python -c "import
    time;time.sleep(1);import sy
    s;sys.stdout.write('hello\r\n');\
    sys.stdout.flush();[i for i in xrange(10000000)];\
    sys.stdout.write('goodbye\r\n');sys.stdout.flush()" &
    [2] 1468
    bash-2.05b$ hello
    hello
    goodbye
    goodbye

    [1]- Done /cygdrive/c/python24/python -c
    "import time;time.s
    leep(1);import
    sys;sys.stdout.write('hello\r\n');sys.stdout.flush();[i for i in
    xrange(10000000)];sys.stdout.write('goodbye\r\n');sys.stdout.flush()"
    [2]+ Done /cygdrive/c/python24/python -c
    "import time;time.s
    leep(1);import
    sys;sys.stdout.write('hello\r\n');sys.stdout.flush();[i for i in
    xrange(10000000)];sys.stdout.write('goodbye\r\n');sys.stdout.flush()"
    bash-2.05b$

    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=1188172

    What's the matter with the filenames, then? If the OP is
    right and when the filenames differ, parallel is no problem,
    is it a webserver problem too?

    @jafo
    Copy link
    Mannequin

    jafo mannequin commented Jun 30, 2005

    Logged In: YES
    user_id=81797

    This is definitely not a Python problem. If I run your
    script from two terminal windows from Python directly, they
    both finish at the same time. So, this is either something
    in how your browser or proxy is sending requests (perhaps
    there is some serialization going on in there), or something
    with how your web server is handling the requests. I can't
    say for sure, but it's unlikely to be an issue with Python.
    I'm closing this ticket because of that.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant